Loading services/core/java/com/android/server/notification/ManagedServices.java +6 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,12 @@ abstract public class ManagedServices { rebindServices(); } public void onUserUnlocked(int user) { if (DEBUG) Slog.d(TAG, "onUserUnlocked u=" + user); rebuildRestoredPackages(); rebindServices(); } public ManagedServiceInfo getServiceFromTokenLocked(IInterface service) { if (service == null) { return null; Loading services/core/java/com/android/server/notification/NotificationManagerService.java +7 −0 Original line number Diff line number Diff line Loading @@ -816,6 +816,12 @@ public class NotificationManagerService extends SystemService { } else if (action.equals(Intent.ACTION_USER_REMOVED)) { final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); mZenModeHelper.onUserRemoved(user); } else if (action.equals(Intent.ACTION_USER_UNLOCKED)) { final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); mConditionProviders.onUserUnlocked(user); mListeners.onUserUnlocked(user); mAssistant.onUserUnlocked(user); mZenModeHelper.onUserUnlocked(user); } } }; Loading Loading @@ -994,6 +1000,7 @@ public class NotificationManagerService extends SystemService { filter.addAction(Intent.ACTION_USER_SWITCHED); filter.addAction(Intent.ACTION_USER_ADDED); filter.addAction(Intent.ACTION_USER_REMOVED); filter.addAction(Intent.ACTION_USER_UNLOCKED); filter.addAction(Intent.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED); getContext().registerReceiver(mIntentReceiver, filter); Loading services/core/java/com/android/server/notification/ZenModeHelper.java +17 −10 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.server.notification; import static android.media.AudioAttributes.USAGE_ALARM; import static android.media.AudioAttributes.USAGE_NOTIFICATION; import static android.media.AudioAttributes.USAGE_NOTIFICATION_RINGTONE; import static android.media.AudioAttributes.USAGE_UNKNOWN; Loading Loading @@ -195,27 +194,35 @@ public class ZenModeHelper { } public void onUserSwitched(int user) { loadConfigForUser(user, "onUserSwitched"); } public void onUserRemoved(int user) { if (user < UserHandle.USER_SYSTEM) return; if (DEBUG) Log.d(TAG, "onUserRemoved u=" + user); mConfigs.remove(user); } public void onUserUnlocked(int user) { loadConfigForUser(user, "onUserUnlocked"); } private void loadConfigForUser(int user, String reason) { if (mUser == user || user < UserHandle.USER_SYSTEM) return; mUser = user; if (DEBUG) Log.d(TAG, "onUserSwitched u=" + user); if (DEBUG) Log.d(TAG, reason + " u=" + user); ZenModeConfig config = mConfigs.get(user); if (config == null) { if (DEBUG) Log.d(TAG, "onUserSwitched: generating default config for user " + user); if (DEBUG) Log.d(TAG, reason + " generating default config for user " + user); config = mDefaultConfig.copy(); config.user = user; } synchronized (mConfig) { setConfigLocked(config, "onUserSwitched"); setConfigLocked(config, reason); } cleanUpZenRules(); } public void onUserRemoved(int user) { if (user < UserHandle.USER_SYSTEM) return; if (DEBUG) Log.d(TAG, "onUserRemoved u=" + user); mConfigs.remove(user); } public int getZenModeListenerInterruptionFilter() { return NotificationManager.zenModeToInterruptionFilter(mZenMode); } Loading Loading
services/core/java/com/android/server/notification/ManagedServices.java +6 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,12 @@ abstract public class ManagedServices { rebindServices(); } public void onUserUnlocked(int user) { if (DEBUG) Slog.d(TAG, "onUserUnlocked u=" + user); rebuildRestoredPackages(); rebindServices(); } public ManagedServiceInfo getServiceFromTokenLocked(IInterface service) { if (service == null) { return null; Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +7 −0 Original line number Diff line number Diff line Loading @@ -816,6 +816,12 @@ public class NotificationManagerService extends SystemService { } else if (action.equals(Intent.ACTION_USER_REMOVED)) { final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); mZenModeHelper.onUserRemoved(user); } else if (action.equals(Intent.ACTION_USER_UNLOCKED)) { final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); mConditionProviders.onUserUnlocked(user); mListeners.onUserUnlocked(user); mAssistant.onUserUnlocked(user); mZenModeHelper.onUserUnlocked(user); } } }; Loading Loading @@ -994,6 +1000,7 @@ public class NotificationManagerService extends SystemService { filter.addAction(Intent.ACTION_USER_SWITCHED); filter.addAction(Intent.ACTION_USER_ADDED); filter.addAction(Intent.ACTION_USER_REMOVED); filter.addAction(Intent.ACTION_USER_UNLOCKED); filter.addAction(Intent.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED); getContext().registerReceiver(mIntentReceiver, filter); Loading
services/core/java/com/android/server/notification/ZenModeHelper.java +17 −10 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.server.notification; import static android.media.AudioAttributes.USAGE_ALARM; import static android.media.AudioAttributes.USAGE_NOTIFICATION; import static android.media.AudioAttributes.USAGE_NOTIFICATION_RINGTONE; import static android.media.AudioAttributes.USAGE_UNKNOWN; Loading Loading @@ -195,27 +194,35 @@ public class ZenModeHelper { } public void onUserSwitched(int user) { loadConfigForUser(user, "onUserSwitched"); } public void onUserRemoved(int user) { if (user < UserHandle.USER_SYSTEM) return; if (DEBUG) Log.d(TAG, "onUserRemoved u=" + user); mConfigs.remove(user); } public void onUserUnlocked(int user) { loadConfigForUser(user, "onUserUnlocked"); } private void loadConfigForUser(int user, String reason) { if (mUser == user || user < UserHandle.USER_SYSTEM) return; mUser = user; if (DEBUG) Log.d(TAG, "onUserSwitched u=" + user); if (DEBUG) Log.d(TAG, reason + " u=" + user); ZenModeConfig config = mConfigs.get(user); if (config == null) { if (DEBUG) Log.d(TAG, "onUserSwitched: generating default config for user " + user); if (DEBUG) Log.d(TAG, reason + " generating default config for user " + user); config = mDefaultConfig.copy(); config.user = user; } synchronized (mConfig) { setConfigLocked(config, "onUserSwitched"); setConfigLocked(config, reason); } cleanUpZenRules(); } public void onUserRemoved(int user) { if (user < UserHandle.USER_SYSTEM) return; if (DEBUG) Log.d(TAG, "onUserRemoved u=" + user); mConfigs.remove(user); } public int getZenModeListenerInterruptionFilter() { return NotificationManager.zenModeToInterruptionFilter(mZenMode); } Loading