Loading services/core/java/com/android/server/wm/ActivityRecord.java +6 −1 Original line number Diff line number Diff line Loading @@ -926,6 +926,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A private final ActivityRecordInputSink mActivityRecordInputSink; // Activities with this uid are allowed to not create an input sink while being in the same // task and directly above this ActivityRecord. This field is updated whenever a new activity // is launched from this ActivityRecord. Touches are always allowed within the same uid. int mAllowedTouchUid; private final Runnable mPauseTimeoutRunnable = new Runnable() { @Override public void run() { Loading Loading @@ -2099,7 +2104,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } mAtmService.mPackageConfigPersister.updateConfigIfNeeded(this, mUserId, packageName); mActivityRecordInputSink = new ActivityRecordInputSink(this); mActivityRecordInputSink = new ActivityRecordInputSink(this, sourceRecord); updateEnterpriseThumbnailDrawable(mAtmService.mUiContext); } Loading services/core/java/com/android/server/wm/ActivityRecordInputSink.java +13 −4 Original line number Diff line number Diff line Loading @@ -42,14 +42,16 @@ class ActivityRecordInputSink { private InputWindowHandleWrapper mInputWindowHandleWrapper; private SurfaceControl mSurfaceControl; private boolean mDisabled = false; ActivityRecordInputSink(ActivityRecord activityRecord) { ActivityRecordInputSink(ActivityRecord activityRecord, ActivityRecord sourceRecord) { mActivityRecord = activityRecord; mIsCompatEnabled = CompatChanges.isChangeEnabled(ENABLE_TOUCH_OPAQUE_ACTIVITIES, mActivityRecord.getUid()); mName = Integer.toHexString(System.identityHashCode(this)) + " ActivityRecordInputSink " + mActivityRecord.mActivityComponent.flattenToShortString(); if (sourceRecord != null) { sourceRecord.mAllowedTouchUid = mActivityRecord.getUid(); } } public void applyChangesToSurfaceIfChanged(SurfaceControl.Transaction transaction) { Loading Loading @@ -77,8 +79,15 @@ class ActivityRecordInputSink { if (mInputWindowHandleWrapper == null) { mInputWindowHandleWrapper = new InputWindowHandleWrapper(createInputWindowHandle()); } if (mDisabled || !mIsCompatEnabled || mActivityRecord.isInTransition()) { // TODO(b/208662670): Investigate if we can have feature active during animations. // Don't block touches from passing through to an activity below us in the same task, if // that activity is either from the same uid or if that activity has launched an activity // in our uid. final ActivityRecord activityBelowInTask = mActivityRecord.getTask().getActivityBelow(mActivityRecord); final boolean allowPassthrough = activityBelowInTask != null && ( activityBelowInTask.mAllowedTouchUid == mActivityRecord.getUid() || activityBelowInTask.isUid(mActivityRecord.getUid())); if (allowPassthrough || !mIsCompatEnabled || mActivityRecord.isInTransition()) { mInputWindowHandleWrapper.setInputConfigMasked(InputConfig.NOT_TOUCHABLE, InputConfig.NOT_TOUCHABLE); } else { Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +6 −1 Original line number Diff line number Diff line Loading @@ -926,6 +926,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A private final ActivityRecordInputSink mActivityRecordInputSink; // Activities with this uid are allowed to not create an input sink while being in the same // task and directly above this ActivityRecord. This field is updated whenever a new activity // is launched from this ActivityRecord. Touches are always allowed within the same uid. int mAllowedTouchUid; private final Runnable mPauseTimeoutRunnable = new Runnable() { @Override public void run() { Loading Loading @@ -2099,7 +2104,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } mAtmService.mPackageConfigPersister.updateConfigIfNeeded(this, mUserId, packageName); mActivityRecordInputSink = new ActivityRecordInputSink(this); mActivityRecordInputSink = new ActivityRecordInputSink(this, sourceRecord); updateEnterpriseThumbnailDrawable(mAtmService.mUiContext); } Loading
services/core/java/com/android/server/wm/ActivityRecordInputSink.java +13 −4 Original line number Diff line number Diff line Loading @@ -42,14 +42,16 @@ class ActivityRecordInputSink { private InputWindowHandleWrapper mInputWindowHandleWrapper; private SurfaceControl mSurfaceControl; private boolean mDisabled = false; ActivityRecordInputSink(ActivityRecord activityRecord) { ActivityRecordInputSink(ActivityRecord activityRecord, ActivityRecord sourceRecord) { mActivityRecord = activityRecord; mIsCompatEnabled = CompatChanges.isChangeEnabled(ENABLE_TOUCH_OPAQUE_ACTIVITIES, mActivityRecord.getUid()); mName = Integer.toHexString(System.identityHashCode(this)) + " ActivityRecordInputSink " + mActivityRecord.mActivityComponent.flattenToShortString(); if (sourceRecord != null) { sourceRecord.mAllowedTouchUid = mActivityRecord.getUid(); } } public void applyChangesToSurfaceIfChanged(SurfaceControl.Transaction transaction) { Loading Loading @@ -77,8 +79,15 @@ class ActivityRecordInputSink { if (mInputWindowHandleWrapper == null) { mInputWindowHandleWrapper = new InputWindowHandleWrapper(createInputWindowHandle()); } if (mDisabled || !mIsCompatEnabled || mActivityRecord.isInTransition()) { // TODO(b/208662670): Investigate if we can have feature active during animations. // Don't block touches from passing through to an activity below us in the same task, if // that activity is either from the same uid or if that activity has launched an activity // in our uid. final ActivityRecord activityBelowInTask = mActivityRecord.getTask().getActivityBelow(mActivityRecord); final boolean allowPassthrough = activityBelowInTask != null && ( activityBelowInTask.mAllowedTouchUid == mActivityRecord.getUid() || activityBelowInTask.isUid(mActivityRecord.getUid())); if (allowPassthrough || !mIsCompatEnabled || mActivityRecord.isInTransition()) { mInputWindowHandleWrapper.setInputConfigMasked(InputConfig.NOT_TOUCHABLE, InputConfig.NOT_TOUCHABLE); } else { Loading