From cd941213a237073fea567f0faf0098ec23459fb5 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Sun, 27 Nov 2016 14:19:26 -0800 Subject: Revert more integrity check changes. The integrity checking features never shipped as part of a release. Delete the stale code. This conceptually reverts the following commits: * c7d64c134ae786cc41af78a3e7dfbfeda8be4287 * ee2b49283261f7b4518ec7c98f568f883f817c9d Test: Device boots and no obvious problems. Change-Id: I8d1589b38ddbcdf26f5132476b8cdfba7ef439cd --- core/res/res/values/strings.xml | 5 -- core/res/res/values/symbols.xml | 2 - .../com/android/server/power/ShutdownThread.java | 3 -- .../android/server/wm/WindowManagerService.java | 53 +--------------------- 4 files changed, 2 insertions(+), 61 deletions(-) diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index baf3cd817d5b..4070d4802732 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -4440,11 +4440,6 @@ Reset now - - Factory reset to use this device without restrictions - - Touch to learn more. - Disabled %1$s diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 5b608b84c51d..a28a6fdc219a 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1920,8 +1920,6 @@ - - diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java index cd966ef323b7..841e2a158c4f 100644 --- a/services/core/java/com/android/server/power/ShutdownThread.java +++ b/services/core/java/com/android/server/power/ShutdownThread.java @@ -94,9 +94,6 @@ public final class ShutdownThread extends Thread { public static final String REBOOT_SAFEMODE_PROPERTY = "persist.sys.safemode"; public static final String RO_SAFEMODE_PROPERTY = "ro.sys.safemode"; - // Indicates whether we should stay in safe mode until ro.build.date.utc is newer than this - public static final String AUDIT_SAFEMODE_PROPERTY = "persist.sys.audit_safemode"; - // static instance of this thread private static final ShutdownThread sInstance = new ShutdownThread(); diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 00d8fba09a58..9b089ec576dd 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -25,9 +25,6 @@ import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.AppOpsManager; import android.app.IActivityManager; -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; import android.content.ContentResolver; @@ -331,8 +328,6 @@ public class WindowManagerService extends IWindowManager.Stub private static final float DRAG_SHADOW_ALPHA_TRANSPARENT = .7071f; - private static final String PROPERTY_BUILD_DATE_UTC = "ro.build.date.utc"; - // Enums for animation scale update types. @Retention(RetentionPolicy.SOURCE) @IntDef({WINDOW_ANIMATION_SCALE, TRANSITION_ANIMATION_SCALE, ANIMATION_DURATION_SCALE}) @@ -5974,35 +5969,6 @@ public class WindowManagerService extends IWindowManager.Stub mFocusedApp.mTask.mStack : null; } - private void showAuditSafeModeNotification() { - PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, - new Intent(Intent.ACTION_VIEW, - Uri.parse("https://support.google.com/nexus/answer/2852139")), 0); - - String title = mContext.getString(R.string.audit_safemode_notification); - - Notification notification = new Notification.Builder(mContext) - .setSmallIcon(com.android.internal.R.drawable.stat_sys_warning) - .setWhen(0) - .setOngoing(true) - .setTicker(title) - .setLocalOnly(true) - .setPriority(Notification.PRIORITY_HIGH) - .setVisibility(Notification.VISIBILITY_PUBLIC) - .setColor(mContext.getColor( - com.android.internal.R.color.system_notification_accent_color)) - .setContentTitle(title) - .setContentText(mContext.getString(R.string.audit_safemode_notification_details)) - .setContentIntent(pendingIntent) - .build(); - - NotificationManager notificationManager = (NotificationManager) mContext - .getSystemService(Context.NOTIFICATION_SERVICE); - - notificationManager.notifyAsUser(null, R.string.audit_safemode_notification, notification, - UserHandle.ALL); - } - public boolean detectSafeMode() { if (!mInputMonitor.waitForInputDevicesReady( INPUT_DEVICES_READY_FOR_SAFE_MODE_DETECTION_TIMEOUT_MILLIS)) { @@ -6030,23 +5996,8 @@ public class WindowManagerService extends IWindowManager.Stub try { if (SystemProperties.getInt(ShutdownThread.REBOOT_SAFEMODE_PROPERTY, 0) != 0 || SystemProperties.getInt(ShutdownThread.RO_SAFEMODE_PROPERTY, 0) != 0) { - int auditSafeMode = SystemProperties.getInt(ShutdownThread.AUDIT_SAFEMODE_PROPERTY, 0); - - if (auditSafeMode == 0) { - mSafeMode = true; - SystemProperties.set(ShutdownThread.REBOOT_SAFEMODE_PROPERTY, ""); - } else { - // stay in safe mode until we have updated to a newer build - int buildDate = SystemProperties.getInt(PROPERTY_BUILD_DATE_UTC, 0); - - if (auditSafeMode >= buildDate) { - mSafeMode = true; - showAuditSafeModeNotification(); - } else { - SystemProperties.set(ShutdownThread.REBOOT_SAFEMODE_PROPERTY, ""); - SystemProperties.set(ShutdownThread.AUDIT_SAFEMODE_PROPERTY, ""); - } - } + mSafeMode = true; + SystemProperties.set(ShutdownThread.REBOOT_SAFEMODE_PROPERTY, ""); } } catch (IllegalArgumentException e) { } -- cgit v1.2.3-59-g8ed1b