Introduce preserveLegacyExternalStorage manifest attribute

This attribute will default to false and does nothing in the false
state.

In the true state, it will allow an updating app preserve any legacy
storage access from the existing installed version on device.

Test: atest RestrictedPermissionsTest
Test: atest RestrictedStoragePermissionSharedUidTest
Bug: 148944140
Change-Id: Id5b6d7aadd9d9844c8bd1164087a9e093481e234
This commit is contained in:
Zim
2020-02-07 15:06:09 +00:00
committed by Nandana Dutt
parent f45a4b7da9
commit 752ff5a127
3 changed files with 17 additions and 0 deletions

View File

@@ -1082,6 +1082,7 @@ package android {
field public static final int preferenceScreenStyle = 16842891; // 0x101008b
field public static final int preferenceStyle = 16842894; // 0x101008e
field public static final int presentationTheme = 16843712; // 0x10103c0
field public static final int preserveLegacyExternalStorage = 16844312; // 0x1010618
field public static final int previewImage = 16843482; // 0x10102da
field public static final int primaryContentAlpha = 16844114; // 0x1010552
field public static final int priority = 16842780; // 0x101001c

View File

@@ -1770,6 +1770,21 @@
-->
<attr name="requestLegacyExternalStorage" format="boolean" />
<!-- If {@code true} this app would like to preserve the legacy storage
model from a previously installed version. Note that this may not always be
respected due to policy or backwards compatibility reasons.
<p>This has no effect on the first install of an app on a device.
For an updating app, setting this to {@code true} will preserve the legacy behaviour
configured by the {@code requestLegacyExternalStorage} flag. If on an update, this
flag is set to {@code false} then the legacy access is not preserved, such an app can
only have legacy access with the {@code requestLegacyExternalStorage} flag.
<p>
The default value is {@code false}.
-->
<attr name="preserveLegacyExternalStorage" format="boolean" />
<!-- If {@code true} this app declares that it should be visible to all other apps on
device, regardless of what they declare via the {@code queries} tags in their
manifest.

View File

@@ -3018,6 +3018,7 @@
<!-- @hide @SystemApi -->
<public name="isAutofillInlineSuggestionTheme" />
<public name="allowNativeHeapPointerTagging" />
<public name="preserveLegacyExternalStorage" />
</public-group>
<public-group type="drawable" first-id="0x010800b5">