From 8bb5e98ecbb90357690ee5eaf9dcf0e0e703118b Mon Sep 17 00:00:00 2001 From: Wenhao Wang Date: Mon, 30 May 2022 05:30:08 +0000 Subject: [PATCH] Revert "[conflict] Move service initialization am: 38fe45b539" This reverts commit 012cace2ee6a5a0f66710e231a8ebc83a6fe5152. Reason for revert: This CL depends on ag/17823648, which is not merged into qt-qpr1-dev. Change-Id: I503bcc1e979dd4db941cb7754f63a0dc35ce9682 --- .../NotificationManagerService.java | 49 ------------------- 1 file changed, 49 deletions(-) mode change 100755 => 100644 services/core/java/com/android/server/notification/NotificationManagerService.java diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java old mode 100755 new mode 100644 index 4cee0cb73c9d9..44e17838fa708 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1491,53 +1491,6 @@ public class NotificationManagerService extends SystemService { return out; } - protected class StrongAuthTracker extends LockPatternUtils.StrongAuthTracker { - - SparseBooleanArray mUserInLockDownMode = new SparseBooleanArray(); - boolean mIsInLockDownMode = false; - - StrongAuthTracker(Context context) { - super(context); - } - - private boolean containsFlag(int haystack, int needle) { - return (haystack & needle) != 0; - } - - public boolean isInLockDownMode() { - return mIsInLockDownMode; - } - - @Override - public synchronized void onStrongAuthRequiredChanged(int userId) { - boolean userInLockDownModeNext = containsFlag(getStrongAuthForUser(userId), - STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN); - mUserInLockDownMode.put(userId, userInLockDownModeNext); - boolean isInLockDownModeNext = mUserInLockDownMode.indexOfValue(true) != -1; - - if (mIsInLockDownMode == isInLockDownModeNext) { - return; - } - - if (isInLockDownModeNext) { - cancelNotificationsWhenEnterLockDownMode(); - } - - // When the mIsInLockDownMode is true, both notifyPostedLocked and - // notifyRemovedLocked will be dismissed. So we shall call - // cancelNotificationsWhenEnterLockDownMode before we set mIsInLockDownMode - // as true and call postNotificationsWhenExitLockDownMode after we set - // mIsInLockDownMode as false. - mIsInLockDownMode = isInLockDownModeNext; - - if (!isInLockDownModeNext) { - postNotificationsWhenExitLockDownMode(); - } - } - } - - private StrongAuthTracker mStrongAuthTracker; - public NotificationManagerService(Context context) { super(context); Notification.processWhitelistToken = WHITELIST_TOKEN; @@ -1719,7 +1672,6 @@ public class NotificationManagerService extends SystemService { mHandler = new WorkerHandler(looper); mRankingThread.start(); - mStrongAuthTracker = new StrongAuthTracker(getContext()); String[] extractorNames; try { extractorNames = resources.getStringArray(R.array.config_notificationSignalExtractors); @@ -2005,7 +1957,6 @@ public class NotificationManagerService extends SystemService { mRoleObserver = new RoleObserver(getContext().getSystemService(RoleManager.class), mPackageManager, getContext().getMainExecutor()); mRoleObserver.init(); - new LockPatternUtils(getContext()).registerStrongAuthTracker(mStrongAuthTracker); } else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) { // This observer will force an update when observe is called, causing us to // bind to listener services.