Merge "Don't let PIP window control system bars"

This commit is contained in:
TreeHugger Robot
2023-02-09 14:18:35 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 5 deletions

View File

@@ -5115,6 +5115,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
return mDeferHidingClient;
}
boolean canAffectSystemUiFlags() {
return task != null && task.canAffectSystemUiFlags() && isVisible()
&& !inPinnedWindowingMode();
}
@Override
boolean isVisible() {
// If the activity isn't hidden then it is considered visible and there is no need to check

View File

@@ -2067,12 +2067,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
final boolean exiting = mAnimatingExit || mDestroying;
return shown && !exiting;
} else {
final Task task = getTask();
final boolean canFromTask = task != null && task.canAffectSystemUiFlags();
return canFromTask && mActivityRecord.isVisible()
// Do not let snapshot window control the bar
return mActivityRecord.canAffectSystemUiFlags()
// Do not let snapshot window control the bar
&& (mAttrs.type != TYPE_APPLICATION_STARTING
|| !(mStartingData instanceof SnapshotStartingData));
|| !(mStartingData instanceof SnapshotStartingData));
}
}