Loading core/java/android/app/IUserSwitchObserver.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ import android.os.IRemoteCallback; oneway interface IUserSwitchObserver { void onUserSwitching(int newUserId, IRemoteCallback reply); void onUserSwitchComplete(int newUserId); void onForegroundProfileSwitch(int newProfileId); } packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −0 Original line number Diff line number Diff line Loading @@ -763,6 +763,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { mSwitchingUser = false; startListeningForFingerprint(); } @Override public void onForegroundProfileSwitch(int newProfileId) { // Ignore. } }); } catch (RemoteException e) { // TODO Auto-generated catch block Loading services/core/java/com/android/server/InputMethodManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -797,6 +797,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub @Override public void onUserSwitchComplete(int newUserId) throws RemoteException { } @Override public void onForegroundProfileSwitch(int newProfileId) { // Ignore. } }); userId = ActivityManagerNative.getDefault().getCurrentUser().id; } catch (RemoteException e) { Loading services/core/java/com/android/server/TextServicesManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,11 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { @Override public void onUserSwitchComplete(int newUserId) throws RemoteException { } @Override public void onForegroundProfileSwitch(int newProfileId) { // Ignore. } }); userId = ActivityManagerNative.getDefault().getCurrentUser().id; } catch (RemoteException e) { Loading services/core/java/com/android/server/am/ActivityManagerService.java +21 −0 Original line number Diff line number Diff line Loading @@ -1284,6 +1284,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int NOTIFY_CLEARTEXT_NETWORK_MSG = 50; static final int POST_DUMP_HEAP_NOTIFICATION_MSG = 51; static final int DELETE_DUMPHEAP_MSG = 52; static final int FOREGROUND_PROFILE_CHANGED_MSG = 53; static final int FIRST_ACTIVITY_STACK_MSG = 100; static final int FIRST_BROADCAST_QUEUE_MSG = 200; Loading Loading @@ -1922,6 +1923,9 @@ public final class ActivityManagerService extends ActivityManagerNative mMemWatchDumpUid = -1; } } break; case FOREGROUND_PROFILE_CHANGED_MSG: { dispatchForegroundProfileChanged(msg.arg1); } break; } } }; Loading Loading @@ -2523,6 +2527,11 @@ public final class ActivityManagerService extends ActivityManagerNative mWindowManager.setFocusedApp(r.appToken, true); } applyUpdateLockStateLocked(r); if (last != null && last.userId != mFocusedActivity.userId) { mHandler.removeMessages(FOREGROUND_PROFILE_CHANGED_MSG); mHandler.sendMessage(mHandler.obtainMessage(FOREGROUND_PROFILE_CHANGED_MSG, mFocusedActivity.userId, 0)); } } EventLog.writeEvent(EventLogTags.AM_FOCUSED_ACTIVITY, mCurrentUserId, mFocusedActivity == null ? "NULL" : mFocusedActivity.shortComponentName); Loading Loading @@ -19072,6 +19081,18 @@ public final class ActivityManagerService extends ActivityManagerNative return true; } void dispatchForegroundProfileChanged(int userId) { final int N = mUserSwitchObservers.beginBroadcast(); for (int i = 0; i < N; i++) { try { mUserSwitchObservers.getBroadcastItem(i).onForegroundProfileSwitch(userId); } catch (RemoteException e) { // Ignore } } mUserSwitchObservers.finishBroadcast(); } void sendUserSwitchBroadcastsLocked(int oldUserId, int newUserId) { long ident = Binder.clearCallingIdentity(); try { Loading
core/java/android/app/IUserSwitchObserver.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ import android.os.IRemoteCallback; oneway interface IUserSwitchObserver { void onUserSwitching(int newUserId, IRemoteCallback reply); void onUserSwitchComplete(int newUserId); void onForegroundProfileSwitch(int newProfileId); }
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −0 Original line number Diff line number Diff line Loading @@ -763,6 +763,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { mSwitchingUser = false; startListeningForFingerprint(); } @Override public void onForegroundProfileSwitch(int newProfileId) { // Ignore. } }); } catch (RemoteException e) { // TODO Auto-generated catch block Loading
services/core/java/com/android/server/InputMethodManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -797,6 +797,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub @Override public void onUserSwitchComplete(int newUserId) throws RemoteException { } @Override public void onForegroundProfileSwitch(int newProfileId) { // Ignore. } }); userId = ActivityManagerNative.getDefault().getCurrentUser().id; } catch (RemoteException e) { Loading
services/core/java/com/android/server/TextServicesManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,11 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { @Override public void onUserSwitchComplete(int newUserId) throws RemoteException { } @Override public void onForegroundProfileSwitch(int newProfileId) { // Ignore. } }); userId = ActivityManagerNative.getDefault().getCurrentUser().id; } catch (RemoteException e) { Loading
services/core/java/com/android/server/am/ActivityManagerService.java +21 −0 Original line number Diff line number Diff line Loading @@ -1284,6 +1284,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int NOTIFY_CLEARTEXT_NETWORK_MSG = 50; static final int POST_DUMP_HEAP_NOTIFICATION_MSG = 51; static final int DELETE_DUMPHEAP_MSG = 52; static final int FOREGROUND_PROFILE_CHANGED_MSG = 53; static final int FIRST_ACTIVITY_STACK_MSG = 100; static final int FIRST_BROADCAST_QUEUE_MSG = 200; Loading Loading @@ -1922,6 +1923,9 @@ public final class ActivityManagerService extends ActivityManagerNative mMemWatchDumpUid = -1; } } break; case FOREGROUND_PROFILE_CHANGED_MSG: { dispatchForegroundProfileChanged(msg.arg1); } break; } } }; Loading Loading @@ -2523,6 +2527,11 @@ public final class ActivityManagerService extends ActivityManagerNative mWindowManager.setFocusedApp(r.appToken, true); } applyUpdateLockStateLocked(r); if (last != null && last.userId != mFocusedActivity.userId) { mHandler.removeMessages(FOREGROUND_PROFILE_CHANGED_MSG); mHandler.sendMessage(mHandler.obtainMessage(FOREGROUND_PROFILE_CHANGED_MSG, mFocusedActivity.userId, 0)); } } EventLog.writeEvent(EventLogTags.AM_FOCUSED_ACTIVITY, mCurrentUserId, mFocusedActivity == null ? "NULL" : mFocusedActivity.shortComponentName); Loading Loading @@ -19072,6 +19081,18 @@ public final class ActivityManagerService extends ActivityManagerNative return true; } void dispatchForegroundProfileChanged(int userId) { final int N = mUserSwitchObservers.beginBroadcast(); for (int i = 0; i < N; i++) { try { mUserSwitchObservers.getBroadcastItem(i).onForegroundProfileSwitch(userId); } catch (RemoteException e) { // Ignore } } mUserSwitchObservers.finishBroadcast(); } void sendUserSwitchBroadcastsLocked(int oldUserId, int newUserId) { long ident = Binder.clearCallingIdentity(); try {