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

Commit 262b3425 authored by Song Chun Fan's avatar Song Chun Fan Committed by Android (Google) Code Review
Browse files

Merge "[pm/parser] add AndroidManifestAdoptPermissions" into main

parents c5ded196 be9e30a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2322,10 +2322,10 @@ public class PackageParser {

            } else if (tagName.equals(TAG_ADOPT_PERMISSIONS)) {
                sa = res.obtainAttributes(parser,
                        com.android.internal.R.styleable.AndroidManifestOriginalPackage);
                        com.android.internal.R.styleable.AndroidManifestAdoptPermissions);

                String name = sa.getNonConfigurationString(
                        com.android.internal.R.styleable.AndroidManifestOriginalPackage_name, 0);
                        com.android.internal.R.styleable.AndroidManifestAdoptPermissions_name, 0);

                sa.recycle();

+2 −2
Original line number Diff line number Diff line
@@ -3133,9 +3133,9 @@ public class ParsingPackageUtils {

    private static ParseResult<ParsingPackage> parseAdoptPermissions(ParseInput input,
            ParsingPackage pkg, Resources res, XmlResourceParser parser) {
        TypedArray sa = res.obtainAttributes(parser, R.styleable.AndroidManifestOriginalPackage);
        TypedArray sa = res.obtainAttributes(parser, R.styleable.AndroidManifestAdoptPermissions);
        try {
            String name = nonConfigString(0, R.styleable.AndroidManifestOriginalPackage_name, sa);
            String name = nonConfigString(0, R.styleable.AndroidManifestAdoptPermissions_name, sa);
            if (name != null) {
                pkg.addAdoptPermission(name);
            }
+1 −1
Original line number Diff line number Diff line
@@ -722,7 +722,7 @@ public interface AndroidPackage {
     * The names of packages to adopt ownership of permissions from, parsed under {@link
     * ParsingPackageUtils#TAG_ADOPT_PERMISSIONS}.
     *
     * @see R.styleable#AndroidManifestOriginalPackage_name
     * @see R.styleable#AndroidManifestAdoptPermissions_name
     * @hide
     */
    @NonNull
+11 −0
Original line number Diff line number Diff line
@@ -2892,6 +2892,17 @@
        <attr name="name" />
    </declare-styleable>

    <!-- Private tag to declare the package name that the permissions of this package
         is based on.  Only used for packages installed in the system image.  If
         given, the permissions from the other package will be propagated into the
         new package.

         <p>This appears as a child tag of the root
         {@link #AndroidManifest manifest} tag. -->
    <declare-styleable name="AndroidManifestAdoptPermissions" parent="AndroidManifest">
        <attr name="name" />
    </declare-styleable>

    <!-- The <code>processes</code> tag specifies the processes the application will run code in
         and optionally characteristics of those processes.  This tag is optional; if not
         specified, components will simply run in the processes they specify.  If supplied,