Loading packages/SystemUI/src/com/android/systemui/GuestResumeSessionReceiver.java +3 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public class GuestResumeSessionReceiver extends BroadcastReceiver { public void register(Context context) { IntentFilter f = new IntentFilter(Intent.ACTION_USER_SWITCHED); context.registerReceiverAsUser(this, UserHandle.OWNER, context.registerReceiverAsUser(this, UserHandle.SYSTEM, f, null /* permission */, null /* scheduler */); } Loading Loading @@ -121,8 +121,8 @@ public class GuestResumeSessionReceiver extends BroadcastReceiver { try { if (newGuest == null) { Log.e(TAG, "Could not create new guest, switching back to owner"); ActivityManagerNative.getDefault().switchUser(UserHandle.USER_OWNER); Log.e(TAG, "Could not create new guest, switching back to system user"); ActivityManagerNative.getDefault().switchUser(UserHandle.USER_SYSTEM); userManager.removeUser(currentUser.id); WindowManagerGlobal.getWindowManagerService().lockNow(null /* options */); return; Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +1 −1 Original line number Diff line number Diff line Loading @@ -340,7 +340,7 @@ public class KeyguardViewMediator extends SystemUI { @Override public void onUserSwitchComplete(int userId) { mSwitchingUser = false; if (userId != UserHandle.USER_OWNER) { if (userId != UserHandle.USER_SYSTEM) { UserInfo info = UserManager.get(mContext).getUserInfo(userId); if (info != null && info.isGuest()) { // If we just switched to a guest, try to dismiss keyguard. Loading packages/SystemUI/src/com/android/systemui/recents/Recents.java +22 −23 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ITaskStackListener; import android.appwidget.AppWidgetProviderInfo; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; import android.content.Context; Loading Loading @@ -62,15 +61,15 @@ import com.android.systemui.statusbar.phone.PhoneStatusBar; import java.util.ArrayList; /** * Annotation for a method that is only called from the primary user's SystemUI process and will be * Annotation for a method that is only called from the system user's SystemUI process and will be * proxied to the current user. */ @interface ProxyFromPrimaryToCurrentUser {} @interface ProxyFromSystemToCurrentUser {} /** * Annotation for a method that may be called from any user's SystemUI process and will be proxied * to the primary user. * to the system user. */ @interface ProxyFromAnyToPrimaryUser {} @interface ProxyFromAnyToSystemUser {} /** A proxy implementation for the recents component */ public class Recents extends SystemUI Loading Loading @@ -225,7 +224,7 @@ public class Recents extends SystemUI } /** Initializes the Recents. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void start() { if (sInstance == null) { Loading @@ -245,7 +244,7 @@ public class Recents extends SystemUI // Only the owner has the callback to update the SysUI visibility flags, so all non-owner // instances of AlternateRecentsComponent needs to notify the owner when the visibility // changes. if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { mProxyBroadcastReceiver = new RecentsOwnerEventProxyReceiver(); IntentFilter filter = new IntentFilter(); filter.addAction(Recents.ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER); Loading Loading @@ -278,10 +277,10 @@ public class Recents extends SystemUI } /** Shows the Recents. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void showRecents(boolean triggeredFromAltTab, View statusBarView) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { showRecentsInternal(triggeredFromAltTab); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading @@ -302,10 +301,10 @@ public class Recents extends SystemUI } /** Hides the Recents. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { hideRecentsInternal(triggeredFromAltTab, triggeredFromHomeKey); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading @@ -328,10 +327,10 @@ public class Recents extends SystemUI } /** Toggles the Recents activity. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void toggleRecents(Display display, int layoutDirection, View statusBarView) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { toggleRecentsInternal(); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading @@ -351,10 +350,10 @@ public class Recents extends SystemUI } /** Preloads info for the Recents activity. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void preloadRecents() { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { preloadRecentsInternal(); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading Loading @@ -483,9 +482,9 @@ public class Recents extends SystemUI } /** Updates on configuration change. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser public void onConfigurationChanged(Configuration newConfig) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { configurationChanged(); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading Loading @@ -849,16 +848,16 @@ public class Recents extends SystemUI } /** Notifies the callbacks that the visibility of Recents has changed. */ @ProxyFromAnyToPrimaryUser @ProxyFromAnyToSystemUser public static void notifyVisibilityChanged(Context context, SystemServicesProxy ssp, boolean visible) { if (ssp.isForegroundUserOwner()) { if (ssp.isForegroundUserSystem()) { visibilityChanged(visible); } else { Intent intent = createLocalBroadcastIntent(context, ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER); intent.putExtra(EXTRA_RECENTS_VISIBILITY, visible); context.sendBroadcastAsUser(intent, UserHandle.OWNER); context.sendBroadcastAsUser(intent, UserHandle.SYSTEM); } } static void visibilityChanged(boolean visible) { Loading @@ -868,14 +867,14 @@ public class Recents extends SystemUI } /** Notifies the status bar to trigger screen pinning. */ @ProxyFromAnyToPrimaryUser @ProxyFromAnyToSystemUser public static void startScreenPinning(Context context, SystemServicesProxy ssp) { if (ssp.isForegroundUserOwner()) { if (ssp.isForegroundUserSystem()) { onStartScreenPinning(context); } else { Intent intent = createLocalBroadcastIntent(context, ACTION_PROXY_SCREEN_PINNING_REQUEST_TO_OWNER); context.sendBroadcastAsUser(intent, UserHandle.OWNER); context.sendBroadcastAsUser(intent, UserHandle.SYSTEM); } } static void onStartScreenPinning(Context context) { Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +2 −2 Original line number Diff line number Diff line Loading @@ -526,10 +526,10 @@ public class SystemServicesProxy { /** * Returns whether the foreground user is the owner. */ public boolean isForegroundUserOwner() { public boolean isForegroundUserSystem() { if (mAm == null) return false; return mAm.getCurrentUser() == UserHandle.USER_OWNER; return mAm.getCurrentUser() == UserHandle.USER_SYSTEM; } /** Loading packages/SystemUI/src/com/android/systemui/settings/CurrentUserTracker.java +0 −4 Original line number Diff line number Diff line Loading @@ -58,8 +58,4 @@ public abstract class CurrentUserTracker extends BroadcastReceiver { } public abstract void onUserSwitched(int newUserId); public boolean isCurrentUserOwner() { return mCurrentUserId == UserHandle.USER_OWNER; } } Loading
packages/SystemUI/src/com/android/systemui/GuestResumeSessionReceiver.java +3 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public class GuestResumeSessionReceiver extends BroadcastReceiver { public void register(Context context) { IntentFilter f = new IntentFilter(Intent.ACTION_USER_SWITCHED); context.registerReceiverAsUser(this, UserHandle.OWNER, context.registerReceiverAsUser(this, UserHandle.SYSTEM, f, null /* permission */, null /* scheduler */); } Loading Loading @@ -121,8 +121,8 @@ public class GuestResumeSessionReceiver extends BroadcastReceiver { try { if (newGuest == null) { Log.e(TAG, "Could not create new guest, switching back to owner"); ActivityManagerNative.getDefault().switchUser(UserHandle.USER_OWNER); Log.e(TAG, "Could not create new guest, switching back to system user"); ActivityManagerNative.getDefault().switchUser(UserHandle.USER_SYSTEM); userManager.removeUser(currentUser.id); WindowManagerGlobal.getWindowManagerService().lockNow(null /* options */); return; Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +1 −1 Original line number Diff line number Diff line Loading @@ -340,7 +340,7 @@ public class KeyguardViewMediator extends SystemUI { @Override public void onUserSwitchComplete(int userId) { mSwitchingUser = false; if (userId != UserHandle.USER_OWNER) { if (userId != UserHandle.USER_SYSTEM) { UserInfo info = UserManager.get(mContext).getUserInfo(userId); if (info != null && info.isGuest()) { // If we just switched to a guest, try to dismiss keyguard. Loading
packages/SystemUI/src/com/android/systemui/recents/Recents.java +22 −23 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ITaskStackListener; import android.appwidget.AppWidgetProviderInfo; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; import android.content.Context; Loading Loading @@ -62,15 +61,15 @@ import com.android.systemui.statusbar.phone.PhoneStatusBar; import java.util.ArrayList; /** * Annotation for a method that is only called from the primary user's SystemUI process and will be * Annotation for a method that is only called from the system user's SystemUI process and will be * proxied to the current user. */ @interface ProxyFromPrimaryToCurrentUser {} @interface ProxyFromSystemToCurrentUser {} /** * Annotation for a method that may be called from any user's SystemUI process and will be proxied * to the primary user. * to the system user. */ @interface ProxyFromAnyToPrimaryUser {} @interface ProxyFromAnyToSystemUser {} /** A proxy implementation for the recents component */ public class Recents extends SystemUI Loading Loading @@ -225,7 +224,7 @@ public class Recents extends SystemUI } /** Initializes the Recents. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void start() { if (sInstance == null) { Loading @@ -245,7 +244,7 @@ public class Recents extends SystemUI // Only the owner has the callback to update the SysUI visibility flags, so all non-owner // instances of AlternateRecentsComponent needs to notify the owner when the visibility // changes. if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { mProxyBroadcastReceiver = new RecentsOwnerEventProxyReceiver(); IntentFilter filter = new IntentFilter(); filter.addAction(Recents.ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER); Loading Loading @@ -278,10 +277,10 @@ public class Recents extends SystemUI } /** Shows the Recents. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void showRecents(boolean triggeredFromAltTab, View statusBarView) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { showRecentsInternal(triggeredFromAltTab); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading @@ -302,10 +301,10 @@ public class Recents extends SystemUI } /** Hides the Recents. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { hideRecentsInternal(triggeredFromAltTab, triggeredFromHomeKey); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading @@ -328,10 +327,10 @@ public class Recents extends SystemUI } /** Toggles the Recents activity. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void toggleRecents(Display display, int layoutDirection, View statusBarView) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { toggleRecentsInternal(); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading @@ -351,10 +350,10 @@ public class Recents extends SystemUI } /** Preloads info for the Recents activity. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser @Override public void preloadRecents() { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { preloadRecentsInternal(); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading Loading @@ -483,9 +482,9 @@ public class Recents extends SystemUI } /** Updates on configuration change. */ @ProxyFromPrimaryToCurrentUser @ProxyFromSystemToCurrentUser public void onConfigurationChanged(Configuration newConfig) { if (mSystemServicesProxy.isForegroundUserOwner()) { if (mSystemServicesProxy.isForegroundUserSystem()) { configurationChanged(); } else { Intent intent = createLocalBroadcastIntent(mContext, Loading Loading @@ -849,16 +848,16 @@ public class Recents extends SystemUI } /** Notifies the callbacks that the visibility of Recents has changed. */ @ProxyFromAnyToPrimaryUser @ProxyFromAnyToSystemUser public static void notifyVisibilityChanged(Context context, SystemServicesProxy ssp, boolean visible) { if (ssp.isForegroundUserOwner()) { if (ssp.isForegroundUserSystem()) { visibilityChanged(visible); } else { Intent intent = createLocalBroadcastIntent(context, ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER); intent.putExtra(EXTRA_RECENTS_VISIBILITY, visible); context.sendBroadcastAsUser(intent, UserHandle.OWNER); context.sendBroadcastAsUser(intent, UserHandle.SYSTEM); } } static void visibilityChanged(boolean visible) { Loading @@ -868,14 +867,14 @@ public class Recents extends SystemUI } /** Notifies the status bar to trigger screen pinning. */ @ProxyFromAnyToPrimaryUser @ProxyFromAnyToSystemUser public static void startScreenPinning(Context context, SystemServicesProxy ssp) { if (ssp.isForegroundUserOwner()) { if (ssp.isForegroundUserSystem()) { onStartScreenPinning(context); } else { Intent intent = createLocalBroadcastIntent(context, ACTION_PROXY_SCREEN_PINNING_REQUEST_TO_OWNER); context.sendBroadcastAsUser(intent, UserHandle.OWNER); context.sendBroadcastAsUser(intent, UserHandle.SYSTEM); } } static void onStartScreenPinning(Context context) { Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +2 −2 Original line number Diff line number Diff line Loading @@ -526,10 +526,10 @@ public class SystemServicesProxy { /** * Returns whether the foreground user is the owner. */ public boolean isForegroundUserOwner() { public boolean isForegroundUserSystem() { if (mAm == null) return false; return mAm.getCurrentUser() == UserHandle.USER_OWNER; return mAm.getCurrentUser() == UserHandle.USER_SYSTEM; } /** Loading
packages/SystemUI/src/com/android/systemui/settings/CurrentUserTracker.java +0 −4 Original line number Diff line number Diff line Loading @@ -58,8 +58,4 @@ public abstract class CurrentUserTracker extends BroadcastReceiver { } public abstract void onUserSwitched(int newUserId); public boolean isCurrentUserOwner() { return mCurrentUserId == UserHandle.USER_OWNER; } }