Loading core/java/android/content/pm/ApplicationInfo.java +14 −2 Original line number Original line Diff line number Diff line Loading @@ -1000,6 +1000,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ */ public String appComponentFactory; public String appComponentFactory; /** * Indicates whether this package requires access to non-SDK APIs. Only system apps * and tests are allowed to use this property. * @hide */ public boolean usesNonSdkApi; /** /** * The category of this app. Categories are used to cluster multiple apps * The category of this app. Categories are used to cluster multiple apps * together into meaningful groups, such as when summarizing battery, * together into meaningful groups, such as when summarizing battery, Loading Loading @@ -1698,8 +1705,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { } } private boolean isAllowedToUseHiddenApis() { private boolean isAllowedToUseHiddenApis() { return isSignedWithPlatformKey() if (isSignedWithPlatformKey()) { || (isPackageWhitelistedForHiddenApis() && (isSystemApp() || isUpdatedSystemApp())); return true; } else if (isSystemApp() || isUpdatedSystemApp()) { return usesNonSdkApi || isPackageWhitelistedForHiddenApis(); } else { return false; } } } /** /** Loading core/java/android/content/pm/PackageParser.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -3580,6 +3580,9 @@ public class PackageParser { ai.appComponentFactory = buildClassName(ai.packageName, factory, outError); ai.appComponentFactory = buildClassName(ai.packageName, factory, outError); } } ai.usesNonSdkApi = sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_usesNonSdkApi, false); if (outError[0] == null) { if (outError[0] == null) { CharSequence pname; CharSequence pname; if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) { if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) { Loading core/res/res/values/attrs_manifest.xml +5 −0 Original line number Original line Diff line number Diff line Loading @@ -1385,6 +1385,8 @@ instantiates items without it.--> instantiates items without it.--> <attr name="appComponentFactory" format="string" /> <attr name="appComponentFactory" format="string" /> <attr name="usesNonSdkApi" format="boolean" /> <!-- The <code>manifest</code> tag is the root of an <!-- The <code>manifest</code> tag is the root of an <code>AndroidManifest.xml</code> file, <code>AndroidManifest.xml</code> file, describing the contents of an Android package (.apk) file. One describing the contents of an Android package (.apk) file. One Loading Loading @@ -1558,6 +1560,9 @@ <attr name="appComponentFactory" /> <attr name="appComponentFactory" /> <!-- Declares that this application should be invoked without non-SDK API enforcement --> <attr name="usesNonSdkApi" /> </declare-styleable> </declare-styleable> <!-- The <code>permission</code> tag declares a security permission that can be <!-- The <code>permission</code> tag declares a security permission that can be used to control access from other packages to specific components or used to control access from other packages to specific components or Loading core/res/res/values/public.xml +5 −0 Original line number Original line Diff line number Diff line Loading @@ -2905,6 +2905,11 @@ <public-group type="attr" first-id="0x01010587"> <public-group type="attr" first-id="0x01010587"> </public-group> </public-group> <public-group type="attr" first-id="0x0101058d"> <!-- @hide For use by platform and tools only. Developers should not specify this value. --> <public name="usesNonSdkApi" /> </public-group> <public-group type="style" first-id="0x010302e2"> <public-group type="style" first-id="0x010302e2"> </public-group> </public-group> Loading services/core/java/com/android/server/am/ActivityManagerService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -21996,8 +21996,8 @@ public class ActivityManagerService extends IActivityManager.Stub activeInstr.mUiAutomationConnection = uiAutomationConnection; activeInstr.mUiAutomationConnection = uiAutomationConnection; activeInstr.mResultClass = className; activeInstr.mResultClass = className; boolean disableHiddenApiChecks = boolean disableHiddenApiChecks = ai.usesNonSdkApi (flags & INSTRUMENTATION_FLAG_DISABLE_HIDDEN_API_CHECKS) != 0; || (flags & INSTRUMENTATION_FLAG_DISABLE_HIDDEN_API_CHECKS) != 0; if (disableHiddenApiChecks) { if (disableHiddenApiChecks) { enforceCallingPermission(android.Manifest.permission.DISABLE_HIDDEN_API_CHECKS, enforceCallingPermission(android.Manifest.permission.DISABLE_HIDDEN_API_CHECKS, "disable hidden API checks"); "disable hidden API checks"); Loading
core/java/android/content/pm/ApplicationInfo.java +14 −2 Original line number Original line Diff line number Diff line Loading @@ -1000,6 +1000,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ */ public String appComponentFactory; public String appComponentFactory; /** * Indicates whether this package requires access to non-SDK APIs. Only system apps * and tests are allowed to use this property. * @hide */ public boolean usesNonSdkApi; /** /** * The category of this app. Categories are used to cluster multiple apps * The category of this app. Categories are used to cluster multiple apps * together into meaningful groups, such as when summarizing battery, * together into meaningful groups, such as when summarizing battery, Loading Loading @@ -1698,8 +1705,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { } } private boolean isAllowedToUseHiddenApis() { private boolean isAllowedToUseHiddenApis() { return isSignedWithPlatformKey() if (isSignedWithPlatformKey()) { || (isPackageWhitelistedForHiddenApis() && (isSystemApp() || isUpdatedSystemApp())); return true; } else if (isSystemApp() || isUpdatedSystemApp()) { return usesNonSdkApi || isPackageWhitelistedForHiddenApis(); } else { return false; } } } /** /** Loading
core/java/android/content/pm/PackageParser.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -3580,6 +3580,9 @@ public class PackageParser { ai.appComponentFactory = buildClassName(ai.packageName, factory, outError); ai.appComponentFactory = buildClassName(ai.packageName, factory, outError); } } ai.usesNonSdkApi = sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_usesNonSdkApi, false); if (outError[0] == null) { if (outError[0] == null) { CharSequence pname; CharSequence pname; if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) { if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) { Loading
core/res/res/values/attrs_manifest.xml +5 −0 Original line number Original line Diff line number Diff line Loading @@ -1385,6 +1385,8 @@ instantiates items without it.--> instantiates items without it.--> <attr name="appComponentFactory" format="string" /> <attr name="appComponentFactory" format="string" /> <attr name="usesNonSdkApi" format="boolean" /> <!-- The <code>manifest</code> tag is the root of an <!-- The <code>manifest</code> tag is the root of an <code>AndroidManifest.xml</code> file, <code>AndroidManifest.xml</code> file, describing the contents of an Android package (.apk) file. One describing the contents of an Android package (.apk) file. One Loading Loading @@ -1558,6 +1560,9 @@ <attr name="appComponentFactory" /> <attr name="appComponentFactory" /> <!-- Declares that this application should be invoked without non-SDK API enforcement --> <attr name="usesNonSdkApi" /> </declare-styleable> </declare-styleable> <!-- The <code>permission</code> tag declares a security permission that can be <!-- The <code>permission</code> tag declares a security permission that can be used to control access from other packages to specific components or used to control access from other packages to specific components or Loading
core/res/res/values/public.xml +5 −0 Original line number Original line Diff line number Diff line Loading @@ -2905,6 +2905,11 @@ <public-group type="attr" first-id="0x01010587"> <public-group type="attr" first-id="0x01010587"> </public-group> </public-group> <public-group type="attr" first-id="0x0101058d"> <!-- @hide For use by platform and tools only. Developers should not specify this value. --> <public name="usesNonSdkApi" /> </public-group> <public-group type="style" first-id="0x010302e2"> <public-group type="style" first-id="0x010302e2"> </public-group> </public-group> Loading
services/core/java/com/android/server/am/ActivityManagerService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -21996,8 +21996,8 @@ public class ActivityManagerService extends IActivityManager.Stub activeInstr.mUiAutomationConnection = uiAutomationConnection; activeInstr.mUiAutomationConnection = uiAutomationConnection; activeInstr.mResultClass = className; activeInstr.mResultClass = className; boolean disableHiddenApiChecks = boolean disableHiddenApiChecks = ai.usesNonSdkApi (flags & INSTRUMENTATION_FLAG_DISABLE_HIDDEN_API_CHECKS) != 0; || (flags & INSTRUMENTATION_FLAG_DISABLE_HIDDEN_API_CHECKS) != 0; if (disableHiddenApiChecks) { if (disableHiddenApiChecks) { enforceCallingPermission(android.Manifest.permission.DISABLE_HIDDEN_API_CHECKS, enforceCallingPermission(android.Manifest.permission.DISABLE_HIDDEN_API_CHECKS, "disable hidden API checks"); "disable hidden API checks");