Loading services/core/java/com/android/server/wm/ActivityStarter.java +8 −6 Original line number Original line Diff line number Diff line Loading @@ -942,8 +942,9 @@ class ActivityStarter { WindowProcessController callerApp, PendingIntentRecord originatingPendingIntent, WindowProcessController callerApp, PendingIntentRecord originatingPendingIntent, boolean allowBackgroundActivityStart, Intent intent) { boolean allowBackgroundActivityStart, Intent intent) { // don't abort for the most important UIDs // don't abort for the most important UIDs if (callingUid == Process.ROOT_UID || callingUid == Process.SYSTEM_UID final int callingAppId = UserHandle.getAppId(callingUid); || callingUid == Process.NFC_UID) { if (callingUid == Process.ROOT_UID || callingAppId == Process.SYSTEM_UID || callingAppId == Process.NFC_UID) { return false; return false; } } // don't abort if the callingUid has a visible window or is a persistent system process // don't abort if the callingUid has a visible window or is a persistent system process Loading @@ -953,8 +954,8 @@ class ActivityStarter { final boolean isCallingUidForeground = callingUidHasAnyVisibleWindow final boolean isCallingUidForeground = callingUidHasAnyVisibleWindow || callingUidProcState == ActivityManager.PROCESS_STATE_TOP || callingUidProcState == ActivityManager.PROCESS_STATE_TOP || callingUidProcState == ActivityManager.PROCESS_STATE_BOUND_TOP; || callingUidProcState == ActivityManager.PROCESS_STATE_BOUND_TOP; final boolean isCallingUidPersistentSystemProcess = (callingUid == Process.SYSTEM_UID) final boolean isCallingUidPersistentSystemProcess = || callingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; callingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; if (callingUidHasAnyVisibleWindow || isCallingUidPersistentSystemProcess) { if (callingUidHasAnyVisibleWindow || isCallingUidPersistentSystemProcess) { return false; return false; } } Loading @@ -969,14 +970,15 @@ class ActivityStarter { ? isCallingUidForeground ? isCallingUidForeground : realCallingUidHasAnyVisibleWindow : realCallingUidHasAnyVisibleWindow || realCallingUidProcState == ActivityManager.PROCESS_STATE_TOP; || realCallingUidProcState == ActivityManager.PROCESS_STATE_TOP; final int realCallingAppId = UserHandle.getAppId(realCallingUid); final boolean isRealCallingUidPersistentSystemProcess = (callingUid == realCallingUid) final boolean isRealCallingUidPersistentSystemProcess = (callingUid == realCallingUid) ? isCallingUidPersistentSystemProcess ? isCallingUidPersistentSystemProcess : (realCallingUid == Process.SYSTEM_UID) : (realCallingAppId == Process.SYSTEM_UID) || realCallingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; || realCallingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; if (realCallingUid != callingUid) { if (realCallingUid != callingUid) { // don't abort if the realCallingUid has a visible window, unless realCallingUid is // don't abort if the realCallingUid has a visible window, unless realCallingUid is // SYSTEM_UID, in which case it start needs to be explicitly whitelisted // SYSTEM_UID, in which case it start needs to be explicitly whitelisted if (realCallingUidHasAnyVisibleWindow && realCallingUid != Process.SYSTEM_UID) { if (realCallingUidHasAnyVisibleWindow && realCallingAppId != Process.SYSTEM_UID) { return false; return false; } } // if the realCallingUid is a persistent system process, abort if the IntentSender // if the realCallingUid is a persistent system process, abort if the IntentSender Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1375,6 +1375,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { .setMayWait(userId) .setMayWait(userId) .setIgnoreTargetSecurity(ignoreTargetSecurity) .setIgnoreTargetSecurity(ignoreTargetSecurity) .setFilterCallingUid(isResolver ? 0 /* system */ : targetUid) .setFilterCallingUid(isResolver ? 0 /* system */ : targetUid) // The target may well be in the background, which would normally prevent it // from starting an activity. Here we definitely want the start to succeed. .setAllowBackgroundActivityStart(true) .execute(); .execute(); } catch (SecurityException e) { } catch (SecurityException e) { // XXX need to figure out how to propagate to original app. // XXX need to figure out how to propagate to original app. Loading Loading
services/core/java/com/android/server/wm/ActivityStarter.java +8 −6 Original line number Original line Diff line number Diff line Loading @@ -942,8 +942,9 @@ class ActivityStarter { WindowProcessController callerApp, PendingIntentRecord originatingPendingIntent, WindowProcessController callerApp, PendingIntentRecord originatingPendingIntent, boolean allowBackgroundActivityStart, Intent intent) { boolean allowBackgroundActivityStart, Intent intent) { // don't abort for the most important UIDs // don't abort for the most important UIDs if (callingUid == Process.ROOT_UID || callingUid == Process.SYSTEM_UID final int callingAppId = UserHandle.getAppId(callingUid); || callingUid == Process.NFC_UID) { if (callingUid == Process.ROOT_UID || callingAppId == Process.SYSTEM_UID || callingAppId == Process.NFC_UID) { return false; return false; } } // don't abort if the callingUid has a visible window or is a persistent system process // don't abort if the callingUid has a visible window or is a persistent system process Loading @@ -953,8 +954,8 @@ class ActivityStarter { final boolean isCallingUidForeground = callingUidHasAnyVisibleWindow final boolean isCallingUidForeground = callingUidHasAnyVisibleWindow || callingUidProcState == ActivityManager.PROCESS_STATE_TOP || callingUidProcState == ActivityManager.PROCESS_STATE_TOP || callingUidProcState == ActivityManager.PROCESS_STATE_BOUND_TOP; || callingUidProcState == ActivityManager.PROCESS_STATE_BOUND_TOP; final boolean isCallingUidPersistentSystemProcess = (callingUid == Process.SYSTEM_UID) final boolean isCallingUidPersistentSystemProcess = || callingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; callingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; if (callingUidHasAnyVisibleWindow || isCallingUidPersistentSystemProcess) { if (callingUidHasAnyVisibleWindow || isCallingUidPersistentSystemProcess) { return false; return false; } } Loading @@ -969,14 +970,15 @@ class ActivityStarter { ? isCallingUidForeground ? isCallingUidForeground : realCallingUidHasAnyVisibleWindow : realCallingUidHasAnyVisibleWindow || realCallingUidProcState == ActivityManager.PROCESS_STATE_TOP; || realCallingUidProcState == ActivityManager.PROCESS_STATE_TOP; final int realCallingAppId = UserHandle.getAppId(realCallingUid); final boolean isRealCallingUidPersistentSystemProcess = (callingUid == realCallingUid) final boolean isRealCallingUidPersistentSystemProcess = (callingUid == realCallingUid) ? isCallingUidPersistentSystemProcess ? isCallingUidPersistentSystemProcess : (realCallingUid == Process.SYSTEM_UID) : (realCallingAppId == Process.SYSTEM_UID) || realCallingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; || realCallingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; if (realCallingUid != callingUid) { if (realCallingUid != callingUid) { // don't abort if the realCallingUid has a visible window, unless realCallingUid is // don't abort if the realCallingUid has a visible window, unless realCallingUid is // SYSTEM_UID, in which case it start needs to be explicitly whitelisted // SYSTEM_UID, in which case it start needs to be explicitly whitelisted if (realCallingUidHasAnyVisibleWindow && realCallingUid != Process.SYSTEM_UID) { if (realCallingUidHasAnyVisibleWindow && realCallingAppId != Process.SYSTEM_UID) { return false; return false; } } // if the realCallingUid is a persistent system process, abort if the IntentSender // if the realCallingUid is a persistent system process, abort if the IntentSender Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1375,6 +1375,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { .setMayWait(userId) .setMayWait(userId) .setIgnoreTargetSecurity(ignoreTargetSecurity) .setIgnoreTargetSecurity(ignoreTargetSecurity) .setFilterCallingUid(isResolver ? 0 /* system */ : targetUid) .setFilterCallingUid(isResolver ? 0 /* system */ : targetUid) // The target may well be in the background, which would normally prevent it // from starting an activity. Here we definitely want the start to succeed. .setAllowBackgroundActivityStart(true) .execute(); .execute(); } catch (SecurityException e) { } catch (SecurityException e) { // XXX need to figure out how to propagate to original app. // XXX need to figure out how to propagate to original app. Loading