Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11921,6 +11921,7 @@ package android.content.pm { method public int getGwpAsanMode(); method public int getMemtagMode(); method public int getNativeHeapZeroInitialized(); method public boolean isProfileable(); method public boolean isProfileableByShell(); method public boolean isResourceOverlay(); method public boolean isVirtualPreload(); core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -6558,7 +6558,7 @@ public final class ActivityThread extends ClientTransactionHandler // Allow binder tracing, and application-generated systrace messages if we're profileable. boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; boolean isAppProfileable = isAppDebuggable || data.appInfo.isProfileableByShell(); boolean isAppProfileable = isAppDebuggable || data.appInfo.isProfileable(); Trace.setAppTracingAllowed(isAppProfileable); if ((isAppProfileable || Build.IS_DEBUGGABLE) && data.enableBinderTracking) { Binder.enableTracing(); Loading core/java/android/content/pm/ApplicationInfo.java +29 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,19 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface ApplicationInfoPrivateFlags {} /** * Value for {@link #privateFlagsExt}: whether this application can be profiled, either by the * shell user or the system. * @hide */ public static final int PRIVATE_FLAG_EXT_PROFILEABLE = 1 << 0; /** @hide */ @IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = { PRIVATE_FLAG_EXT_PROFILEABLE, }) @Retention(RetentionPolicy.SOURCE) public @interface ApplicationInfoPrivateFlagsExt {} /** * Constant corresponding to <code>allowed</code> in the * {@link android.R.attr#autoRevokePermissions} attribute. Loading Loading @@ -803,6 +816,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { @TestApi public @ApplicationInfoPrivateFlags int privateFlags; /** * More private/hidden flags. See {@code PRIVATE_FLAG_EXT_...} constants. * @hide */ public @ApplicationInfoPrivateFlagsExt int privateFlagsExt; /** * @hide */ Loading Loading @@ -1771,6 +1790,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { theme = orig.theme; flags = orig.flags; privateFlags = orig.privateFlags; privateFlagsExt = orig.privateFlagsExt; requiresSmallestWidthDp = orig.requiresSmallestWidthDp; compatibleWidthLimitDp = orig.compatibleWidthLimitDp; largestWidthLimitDp = orig.largestWidthLimitDp; Loading Loading @@ -1855,6 +1875,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeInt(theme); dest.writeInt(flags); dest.writeInt(privateFlags); dest.writeInt(privateFlagsExt); dest.writeInt(requiresSmallestWidthDp); dest.writeInt(compatibleWidthLimitDp); dest.writeInt(largestWidthLimitDp); Loading Loading @@ -1944,6 +1965,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { theme = source.readInt(); flags = source.readInt(); privateFlags = source.readInt(); privateFlagsExt = source.readInt(); requiresSmallestWidthDp = source.readInt(); compatibleWidthLimitDp = source.readInt(); largestWidthLimitDp = source.readInt(); Loading Loading @@ -2363,6 +2385,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { return (privateFlags & PRIVATE_FLAG_PROFILEABLE_BY_SHELL) != 0; } /** * Returns whether this application can be profiled, either by the shell user or the system. */ public boolean isProfileable() { return (privateFlagsExt & PRIVATE_FLAG_EXT_PROFILEABLE) != 0; } /** * Returns true if the app has declared in its manifest that it wants its split APKs to be * loaded into isolated Contexts, with their own ClassLoaders and Resources objects. Loading core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java +9 −0 Original line number Diff line number Diff line Loading @@ -802,6 +802,15 @@ public class PackageInfoWithoutStateUtils { return privateFlags; } /** @see ApplicationInfo#privateFlagsExt */ public static int appInfoPrivateFlagsExt(ParsingPackageRead pkg) { // @formatter:off int privateFlagsExt = flag(pkg.isProfileable(), ApplicationInfo.PRIVATE_FLAG_EXT_PROFILEABLE); // @formatter:on return privateFlagsExt; } private static boolean checkUseInstalled(ParsingPackageRead pkg, PackageUserState state, @PackageManager.PackageInfoFlags int flags) { // If available for the target user Loading core/java/android/content/pm/parsing/ParsingPackage.java +2 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,8 @@ public interface ParsingPackage extends ParsingPackageRead { ParsingPackage setProfileableByShell(boolean profileableByShell); ParsingPackage setProfileable(boolean profileable); ParsingPackage setRequestLegacyExternalStorage(boolean requestLegacyExternalStorage); ParsingPackage setAllowNativeHeapPointerTagging(boolean allowNativeHeapPointerTagging); Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11921,6 +11921,7 @@ package android.content.pm { method public int getGwpAsanMode(); method public int getMemtagMode(); method public int getNativeHeapZeroInitialized(); method public boolean isProfileable(); method public boolean isProfileableByShell(); method public boolean isResourceOverlay(); method public boolean isVirtualPreload();
core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -6558,7 +6558,7 @@ public final class ActivityThread extends ClientTransactionHandler // Allow binder tracing, and application-generated systrace messages if we're profileable. boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; boolean isAppProfileable = isAppDebuggable || data.appInfo.isProfileableByShell(); boolean isAppProfileable = isAppDebuggable || data.appInfo.isProfileable(); Trace.setAppTracingAllowed(isAppProfileable); if ((isAppProfileable || Build.IS_DEBUGGABLE) && data.enableBinderTracking) { Binder.enableTracing(); Loading
core/java/android/content/pm/ApplicationInfo.java +29 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,19 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface ApplicationInfoPrivateFlags {} /** * Value for {@link #privateFlagsExt}: whether this application can be profiled, either by the * shell user or the system. * @hide */ public static final int PRIVATE_FLAG_EXT_PROFILEABLE = 1 << 0; /** @hide */ @IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = { PRIVATE_FLAG_EXT_PROFILEABLE, }) @Retention(RetentionPolicy.SOURCE) public @interface ApplicationInfoPrivateFlagsExt {} /** * Constant corresponding to <code>allowed</code> in the * {@link android.R.attr#autoRevokePermissions} attribute. Loading Loading @@ -803,6 +816,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { @TestApi public @ApplicationInfoPrivateFlags int privateFlags; /** * More private/hidden flags. See {@code PRIVATE_FLAG_EXT_...} constants. * @hide */ public @ApplicationInfoPrivateFlagsExt int privateFlagsExt; /** * @hide */ Loading Loading @@ -1771,6 +1790,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { theme = orig.theme; flags = orig.flags; privateFlags = orig.privateFlags; privateFlagsExt = orig.privateFlagsExt; requiresSmallestWidthDp = orig.requiresSmallestWidthDp; compatibleWidthLimitDp = orig.compatibleWidthLimitDp; largestWidthLimitDp = orig.largestWidthLimitDp; Loading Loading @@ -1855,6 +1875,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeInt(theme); dest.writeInt(flags); dest.writeInt(privateFlags); dest.writeInt(privateFlagsExt); dest.writeInt(requiresSmallestWidthDp); dest.writeInt(compatibleWidthLimitDp); dest.writeInt(largestWidthLimitDp); Loading Loading @@ -1944,6 +1965,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { theme = source.readInt(); flags = source.readInt(); privateFlags = source.readInt(); privateFlagsExt = source.readInt(); requiresSmallestWidthDp = source.readInt(); compatibleWidthLimitDp = source.readInt(); largestWidthLimitDp = source.readInt(); Loading Loading @@ -2363,6 +2385,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { return (privateFlags & PRIVATE_FLAG_PROFILEABLE_BY_SHELL) != 0; } /** * Returns whether this application can be profiled, either by the shell user or the system. */ public boolean isProfileable() { return (privateFlagsExt & PRIVATE_FLAG_EXT_PROFILEABLE) != 0; } /** * Returns true if the app has declared in its manifest that it wants its split APKs to be * loaded into isolated Contexts, with their own ClassLoaders and Resources objects. Loading
core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java +9 −0 Original line number Diff line number Diff line Loading @@ -802,6 +802,15 @@ public class PackageInfoWithoutStateUtils { return privateFlags; } /** @see ApplicationInfo#privateFlagsExt */ public static int appInfoPrivateFlagsExt(ParsingPackageRead pkg) { // @formatter:off int privateFlagsExt = flag(pkg.isProfileable(), ApplicationInfo.PRIVATE_FLAG_EXT_PROFILEABLE); // @formatter:on return privateFlagsExt; } private static boolean checkUseInstalled(ParsingPackageRead pkg, PackageUserState state, @PackageManager.PackageInfoFlags int flags) { // If available for the target user Loading
core/java/android/content/pm/parsing/ParsingPackage.java +2 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,8 @@ public interface ParsingPackage extends ParsingPackageRead { ParsingPackage setProfileableByShell(boolean profileableByShell); ParsingPackage setProfileable(boolean profileable); ParsingPackage setRequestLegacyExternalStorage(boolean requestLegacyExternalStorage); ParsingPackage setAllowNativeHeapPointerTagging(boolean allowNativeHeapPointerTagging); Loading