OSDN Git Service

Apply app switching protection on AppTask.moveToFront()
authorRicky Wai <rickywai@google.com>
Thu, 11 Apr 2019 16:26:57 +0000 (17:26 +0100)
committerRicky Wai <rickywai@google.com>
Thu, 11 Apr 2019 16:26:57 +0000 (17:26 +0100)
Bug: 129356848
Test: After pressing home button, apps can't be shown automatically
Change-Id: I0d50deae0024c61df3e68fc7cf2d63815a757ef9

services/core/java/com/android/server/wm/AppTaskImpl.java

index e967a92..78f1e69 100644 (file)
@@ -106,6 +106,10 @@ class AppTaskImpl extends IAppTask.Stub {
         final long origId = Binder.clearCallingIdentity();
         try {
             synchronized (mService.mGlobalLock) {
+                if (!mService.checkAppSwitchAllowedLocked(callingPid, callingUid, -1, -1,
+                        "Move to front")) {
+                    return;
+                }
                 WindowProcessController callerApp = null;
                 if (appThread != null) {
                     callerApp = mService.getProcessController(appThread);