Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bae6d0eb authored by Akhil Gangu's avatar Akhil Gangu
Browse files

Add additional manifest attributes to handle purpose declaration app

compatibility.

Adding requiresPurposeTargetSdkVersion attribute under <permission> to
ensure only apps that target a specific SDK version or above require
purpose for a given permission. Also adding maxTargetSdkVersion on
<valid-purpose> for deprecating purposes in the future platform
releases.

Bug: 422817717
Test: m -j99
Flag: EXEMPT no public-staging.xml changes
Change-Id: Ie517d4c7f0177473aa30e7c8d9d4e315a701d946
parent 59d717f7
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -2453,6 +2453,10 @@
             is currently only supported for normal permissions defined within the platform
             manifest. -->
        <attr name="requiresPurpose" format="boolean" />
        <!-- Required to be set when {@code requiresPurpose} is {@code true}; optional otherwise.
             Use it to specify the app's minimum target SDK version for which purpose validation
             should be enforced in order to prevent app compatibility issues. -->
        <attr name="requiresPurposeTargetSdkVersion"  format="integer" />
</declare-styleable>

    <!-- The <code>valid-purpose</code> tag is used to specify valid purpose(s) for a permission.
@@ -2463,6 +2467,12 @@
    <declare-styleable name="AndroidManifestValidPurpose" parent="AndroidManifestPermission">
        <!-- Specify the name of the valid purpose. -->
        <attr name="name" />
        <!-- Optional: This is mainly intended to deprecate a pre-defined purpose. Specify the max
             target SDK version for which this purpose is valid. Not specifying this attribute
             signifies the purpose is valid indefinitely. To avoid app compatibility issues, DO NOT
             simply delete the purpose from the manifest. Note that deprecation of purposes cannot
             be done retroactively on older platform versions. -->
        <attr name="maxTargetSdkVersion" format="integer" />
    </declare-styleable>

    <!-- The <code>permission-group</code> tag declares a logical grouping of