Loading core/java/android/app/Activity.java +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIO import static android.Manifest.permission.DETECT_SCREEN_CAPTURE; import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.inMultiWindowMode; import static android.os.Process.myUid; Loading Loading @@ -9439,6 +9440,15 @@ public class Activity extends ContextThemeWrapper ActivityClient.getInstance().enableTaskLocaleOverride(mToken); } /** * Request ActivityRecordInputSink to enable or disable blocking input events. * @hide */ @RequiresPermission(INTERNAL_SYSTEM_WINDOW) public void setActivityRecordInputSinkEnabled(boolean enabled) { ActivityClient.getInstance().setActivityRecordInputSinkEnabled(mToken, enabled); } class HostCallbacks extends FragmentHostCallback<Activity> { public HostCallbacks() { super(Activity.this /*activity*/); Loading core/java/android/app/ActivityClient.java +11 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app; import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.content.ComponentName; Loading Loading @@ -614,6 +616,15 @@ public class ActivityClient { } } @RequiresPermission(INTERNAL_SYSTEM_WINDOW) void setActivityRecordInputSinkEnabled(IBinder activityToken, boolean enabled) { try { getActivityClientController().setActivityRecordInputSinkEnabled(activityToken, enabled); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** * Shows or hides a Camera app compat toggle for stretched issues with the requested state. * Loading core/java/android/app/IActivityClientController.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -191,4 +191,14 @@ interface IActivityClientController { */ boolean isRequestedToLaunchInTaskFragment(in IBinder activityToken, in IBinder taskFragmentToken); /** * Enable or disable ActivityRecordInputSink to block input events. * * @param token The token for the activity that requests to toggle. * @param enabled Whether the input evens are blocked by ActivityRecordInputSink. */ @JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest" + ".permission.INTERNAL_SYSTEM_WINDOW)") oneway void setActivityRecordInputSinkEnabled(in IBinder activityToken, boolean enabled); } core/java/android/window/flags/window_surfaces.aconfig +9 −1 Original line number Diff line number Diff line Loading @@ -40,3 +40,11 @@ flag { is_fixed_read_only: true bug: "293445881" } flag { namespace: "window_surfaces" name: "allow_disable_activity_record_input_sink" description: "Whether to allow system activity to disable ActivityRecordInputSink" is_fixed_read_only: true bug: "262477923" } services/core/java/com/android/server/wm/ActivityClientController.java +17 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLAS import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_NONE; import static com.android.server.wm.ActivityTaskManagerService.TAG_SWITCH; import static com.android.server.wm.ActivityTaskManagerService.enforceNotIsolatedCaller; import static com.android.window.flags.Flags.allowDisableActivityRecordInputSink; import android.Manifest; import android.annotation.ColorInt; Loading Loading @@ -1688,4 +1689,20 @@ class ActivityClientController extends IActivityClientController.Stub { return r.mRequestedLaunchingTaskFragmentToken == taskFragmentToken; } } @Override public void setActivityRecordInputSinkEnabled(IBinder activityToken, boolean enabled) { if (!allowDisableActivityRecordInputSink()) { return; } mService.mAmInternal.enforceCallingPermission( Manifest.permission.INTERNAL_SYSTEM_WINDOW, "setActivityRecordInputSinkEnabled"); synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.forTokenLocked(activityToken); if (r != null) { r.mActivityRecordInputSinkEnabled = enabled; } } } } Loading
core/java/android/app/Activity.java +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIO import static android.Manifest.permission.DETECT_SCREEN_CAPTURE; import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.inMultiWindowMode; import static android.os.Process.myUid; Loading Loading @@ -9439,6 +9440,15 @@ public class Activity extends ContextThemeWrapper ActivityClient.getInstance().enableTaskLocaleOverride(mToken); } /** * Request ActivityRecordInputSink to enable or disable blocking input events. * @hide */ @RequiresPermission(INTERNAL_SYSTEM_WINDOW) public void setActivityRecordInputSinkEnabled(boolean enabled) { ActivityClient.getInstance().setActivityRecordInputSinkEnabled(mToken, enabled); } class HostCallbacks extends FragmentHostCallback<Activity> { public HostCallbacks() { super(Activity.this /*activity*/); Loading
core/java/android/app/ActivityClient.java +11 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app; import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.content.ComponentName; Loading Loading @@ -614,6 +616,15 @@ public class ActivityClient { } } @RequiresPermission(INTERNAL_SYSTEM_WINDOW) void setActivityRecordInputSinkEnabled(IBinder activityToken, boolean enabled) { try { getActivityClientController().setActivityRecordInputSinkEnabled(activityToken, enabled); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** * Shows or hides a Camera app compat toggle for stretched issues with the requested state. * Loading
core/java/android/app/IActivityClientController.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -191,4 +191,14 @@ interface IActivityClientController { */ boolean isRequestedToLaunchInTaskFragment(in IBinder activityToken, in IBinder taskFragmentToken); /** * Enable or disable ActivityRecordInputSink to block input events. * * @param token The token for the activity that requests to toggle. * @param enabled Whether the input evens are blocked by ActivityRecordInputSink. */ @JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest" + ".permission.INTERNAL_SYSTEM_WINDOW)") oneway void setActivityRecordInputSinkEnabled(in IBinder activityToken, boolean enabled); }
core/java/android/window/flags/window_surfaces.aconfig +9 −1 Original line number Diff line number Diff line Loading @@ -40,3 +40,11 @@ flag { is_fixed_read_only: true bug: "293445881" } flag { namespace: "window_surfaces" name: "allow_disable_activity_record_input_sink" description: "Whether to allow system activity to disable ActivityRecordInputSink" is_fixed_read_only: true bug: "262477923" }
services/core/java/com/android/server/wm/ActivityClientController.java +17 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLAS import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_NONE; import static com.android.server.wm.ActivityTaskManagerService.TAG_SWITCH; import static com.android.server.wm.ActivityTaskManagerService.enforceNotIsolatedCaller; import static com.android.window.flags.Flags.allowDisableActivityRecordInputSink; import android.Manifest; import android.annotation.ColorInt; Loading Loading @@ -1688,4 +1689,20 @@ class ActivityClientController extends IActivityClientController.Stub { return r.mRequestedLaunchingTaskFragmentToken == taskFragmentToken; } } @Override public void setActivityRecordInputSinkEnabled(IBinder activityToken, boolean enabled) { if (!allowDisableActivityRecordInputSink()) { return; } mService.mAmInternal.enforceCallingPermission( Manifest.permission.INTERNAL_SYSTEM_WINDOW, "setActivityRecordInputSinkEnabled"); synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.forTokenLocked(activityToken); if (r != null) { r.mActivityRecordInputSinkEnabled = enabled; } } } }