Loading services/core/java/com/android/server/wm/SafeActivityOptions.java +5 −2 Original line number Diff line number Diff line Loading @@ -361,10 +361,13 @@ public class SafeActivityOptions { } // If launched from bubble is specified, then ensure that the caller is system or sysui. if (options.getLaunchedFromBubble() && !isSystemOrSystemUI(callingPid, callingUid)) { if ((options.getLaunchedFromBubble() || options.getTaskAlwaysOnTop()) && !isSystemOrSystemUI(callingPid, callingUid)) { final String msg = "Permission Denial: starting " + getIntentString(intent) + " from " + callerApp + " (pid=" + callingPid + ", uid=" + callingUid + ") with launchedFromBubble=true"; + ", uid=" + callingUid + ") with" + (options.getLaunchedFromBubble() ? " launchedFromBubble=true" : "") + (options.getTaskAlwaysOnTop() ? " taskAlwaysOnTop=true" : ""); Slog.w(TAG, msg); throw new SecurityException(msg); } Loading services/tests/wmtests/src/com/android/server/wm/SafeActivityOptionsTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,10 @@ public class SafeActivityOptionsTest { activityOptions.setLaunchedFromBubble(true); verifySecureExceptionThrown(activityOptions, taskSupervisor); activityOptions = ActivityOptions.makeBasic(); activityOptions.setTaskAlwaysOnTop(true); verifySecureExceptionThrown(activityOptions, taskSupervisor); activityOptions = ActivityOptions.makeBasic(); activityOptions.setLaunchDisplayId(DEFAULT_DISPLAY); verifySecureExceptionThrown(activityOptions, taskSupervisor); Loading Loading
services/core/java/com/android/server/wm/SafeActivityOptions.java +5 −2 Original line number Diff line number Diff line Loading @@ -361,10 +361,13 @@ public class SafeActivityOptions { } // If launched from bubble is specified, then ensure that the caller is system or sysui. if (options.getLaunchedFromBubble() && !isSystemOrSystemUI(callingPid, callingUid)) { if ((options.getLaunchedFromBubble() || options.getTaskAlwaysOnTop()) && !isSystemOrSystemUI(callingPid, callingUid)) { final String msg = "Permission Denial: starting " + getIntentString(intent) + " from " + callerApp + " (pid=" + callingPid + ", uid=" + callingUid + ") with launchedFromBubble=true"; + ", uid=" + callingUid + ") with" + (options.getLaunchedFromBubble() ? " launchedFromBubble=true" : "") + (options.getTaskAlwaysOnTop() ? " taskAlwaysOnTop=true" : ""); Slog.w(TAG, msg); throw new SecurityException(msg); } Loading
services/tests/wmtests/src/com/android/server/wm/SafeActivityOptionsTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,10 @@ public class SafeActivityOptionsTest { activityOptions.setLaunchedFromBubble(true); verifySecureExceptionThrown(activityOptions, taskSupervisor); activityOptions = ActivityOptions.makeBasic(); activityOptions.setTaskAlwaysOnTop(true); verifySecureExceptionThrown(activityOptions, taskSupervisor); activityOptions = ActivityOptions.makeBasic(); activityOptions.setLaunchDisplayId(DEFAULT_DISPLAY); verifySecureExceptionThrown(activityOptions, taskSupervisor); Loading