diff options
| author | 2024-04-17 17:02:12 +0000 | |
|---|---|---|
| committer | 2024-04-24 14:58:45 +0000 | |
| commit | ceeae6dcff1dddca15b8e3c2781dc1dc3381d1c8 (patch) | |
| tree | 620d523c66930fe014f138c63b8d27a92c737001 /java/src/com | |
| parent | caecd9df601541d0ea4fa31a79e6b1f0fc3d9cb2 (diff) | |
Block taking recents screenshot if private profile available
Sharesheet shows separate tab when private profile is on.
User can move sharesheet to the background (e.g. by launching
other app using shortcut) and then lock private
profile. Recents preview screen shows screenshot
of the Sharesheet at the last moment it was in foreground
(when the space was unlocked). As a result Recents preview
can leak whether private profile exists on device.
This change sets setting to show blank
screen in the recents when private profile is avaialble.
Bug: 333387696
Test: manual, https://buganizer.corp.google.com/issues/333387696#comment8
Change-Id: I8758cd0a311ce93a03d998c4ada8999a6d02246d
Diffstat (limited to 'java/src/com')
| -rw-r--r-- | java/src/com/android/intentresolver/ChooserActivity.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/java/src/com/android/intentresolver/ChooserActivity.java b/java/src/com/android/intentresolver/ChooserActivity.java index 7e2c9c5a..e68ee7f4 100644 --- a/java/src/com/android/intentresolver/ChooserActivity.java +++ b/java/src/com/android/intentresolver/ChooserActivity.java @@ -509,6 +509,8 @@ public class ChooserActivity extends Hilt_ChooserActivity implements mMaxTargetsPerRow, mFeatureFlags); + maybeDisableRecentsScreenshot(mProfiles, mProfileAvailability); + if (!configureContentView(mTargetDataLoader)) { mPersonalPackageMonitor = createPackageMonitor( mChooserMultiProfilePagerAdapter.getPersonalListAdapter()); @@ -647,6 +649,20 @@ public class ChooserActivity extends Hilt_ChooserActivity implements Tracer.INSTANCE.markLaunched(); } + private void maybeDisableRecentsScreenshot( + ProfileHelper profileHelper, ProfileAvailability profileAvailability) { + for (Profile profile : profileHelper.getProfiles()) { + if (profile.getType() == Profile.Type.PRIVATE) { + if (profileAvailability.isAvailable(profile)) { + // Show blank screen in Recent preview if private profile is available + // to not leak its presence. + setRecentsScreenshotEnabled(false); + } + return; + } + } + } + private void onChooserRequestChanged(ChooserRequest chooserRequest) { // intentional reference comarison if (mRequest == chooserRequest) { |