diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-06-12 18:32:03 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-12 18:32:03 +0000 |
commit | 69a5697ee2befe31d18651e6ea2a211b6d44994d (patch) | |
tree | e59d125ace48e89741a8d7d629cd159d252c846b /packages/CarSystemUI/src | |
parent | f4734b20251c2329ef0403ea399a15d58d0afcf3 (diff) | |
parent | 12b5186f2850ff27eb5bd9c935c9500a0d74b04b (diff) |
Merge "Notify window manager service that we are switching users" into rvc-dev am: 12b5186f28
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11821052
Change-Id: Ibc8f185b563c3f800bfbcba5882859946c85dc88
Diffstat (limited to 'packages/CarSystemUI/src')
-rw-r--r-- | packages/CarSystemUI/src/com/android/systemui/car/userswitcher/UserSwitchTransitionViewController.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/UserSwitchTransitionViewController.java b/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/UserSwitchTransitionViewController.java index 775ef8152ca2..8aa7b6389d85 100644 --- a/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/UserSwitchTransitionViewController.java +++ b/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/UserSwitchTransitionViewController.java @@ -23,9 +23,12 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.os.Handler; +import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; +import android.util.Log; +import android.view.IWindowManager; import android.widget.ImageView; import android.widget.TextView; @@ -44,13 +47,14 @@ import javax.inject.Singleton; */ @Singleton public class UserSwitchTransitionViewController extends OverlayViewController { - private static final String TAG = "UserSwitchTransitionViewController"; + private static final String TAG = "UserSwitchTransition"; private static final String ENABLE_DEVELOPER_MESSAGE_TRUE = "true"; private final Context mContext; private final Handler mHandler; private final Resources mResources; private final UserManager mUserManager; + private final IWindowManager mWindowManagerService; @GuardedBy("this") private boolean mShowing; @@ -62,6 +66,7 @@ public class UserSwitchTransitionViewController extends OverlayViewController { @Main Handler handler, @Main Resources resources, UserManager userManager, + IWindowManager windowManagerService, OverlayViewGlobalStateController overlayViewGlobalStateController) { super(R.id.user_switching_dialog_stub, overlayViewGlobalStateController); @@ -70,6 +75,7 @@ public class UserSwitchTransitionViewController extends OverlayViewController { mHandler = handler; mResources = resources; mUserManager = userManager; + mWindowManagerService = windowManagerService; } /** @@ -81,6 +87,13 @@ public class UserSwitchTransitionViewController extends OverlayViewController { if (mPreviousUserId == newUserId || mShowing) return; mShowing = true; mHandler.post(() -> { + try { + mWindowManagerService.setSwitchingUser(true); + mWindowManagerService.lockNow(null); + } catch (RemoteException e) { + Log.e(TAG, "unable to notify window manager service regarding user switch"); + } + start(); populateDialog(mPreviousUserId, newUserId); // next time a new user is selected, this current new user will be the previous user. |