Loading core/java/android/app/ApplicationPackageManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -1609,6 +1609,15 @@ final class ApplicationPackageManager extends PackageManager { return null; } @Override public void setComponentProtectedSetting(ComponentName componentName, boolean newState) { try { mPM.setComponentProtectedSetting(componentName, newState, mContext.getUserId()); } catch (RemoteException re) { Log.e(TAG, "Failed to set component protected setting", re); } } @Override public PackageInstaller getPackageInstaller() { synchronized (mLock) { Loading core/java/android/content/pm/ApplicationInfo.java +10 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; /** * When true, indicates that any one component within this application is * protected. * @hide */ public boolean protect = false; public void dump(Printer pw, String prefix) { super.dumpFront(pw, prefix); if (className != null) { Loading Loading @@ -709,6 +716,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { descriptionRes = orig.descriptionRes; uiOptions = orig.uiOptions; backupAgentName = orig.backupAgentName; protect = orig.protect; } Loading Loading @@ -759,6 +767,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(backupAgentName); dest.writeInt(descriptionRes); dest.writeInt(uiOptions); dest.writeInt(protect ? 1 : 0); } public static final Parcelable.Creator<ApplicationInfo> CREATOR Loading Loading @@ -808,6 +817,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { backupAgentName = source.readString(); descriptionRes = source.readInt(); uiOptions = source.readInt(); protect = source.readInt() != 0; } /** Loading core/java/android/content/pm/IPackageManager.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -455,4 +455,8 @@ interface IPackageManager { KeySet getSigningKeySet(String packageName); boolean isPackageSignedByKeySet(String packageName, in KeySet ks); boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks); /** Protected Apps */ void setComponentProtectedSetting(in ComponentName componentName, in boolean newState, int userId); } core/java/android/content/pm/PackageManager.java +20 −0 Original line number Diff line number Diff line Loading @@ -1686,6 +1686,20 @@ public abstract class PackageManager { public static final String EXTRA_REQUEST_PERMISSION_PERMISSION_LIST = "android.content.pm.extra.PERMISSION_LIST"; /** * Flag for {@link #setComponentProtectedSetting(android.content.ComponentName, boolean)}: * This component or application has set to protected status * @hide */ public static final boolean COMPONENT_PROTECTED_STATUS = false; /** * Flag for {@link #setComponentProtectedSetting(android.content.ComponentName, boolean)}: * This component or application has been explicitly set to visible status * @hide */ public static final boolean COMPONENT_VISIBLE_STATUS = true; /** * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides Loading Loading @@ -3896,6 +3910,12 @@ public abstract class PackageManager { + "/" + packageName; } /** * Update Component protection state * @hide */ public abstract void setComponentProtectedSetting(ComponentName componentName, boolean newState); /** * Adds a {@link CrossProfileIntentFilter}. After calling this method all intents sent from the * user with id sourceUserId can also be be resolved by activities in the user with id Loading core/java/android/content/pm/PackageParser.java +9 −0 Original line number Diff line number Diff line Loading @@ -4604,6 +4604,12 @@ public class PackageParser { && p.usesLibraryFiles != null) { return true; } if (state.protectedComponents != null) { boolean protect = state.protectedComponents.size() > 0; if (p.applicationInfo.protect != protect) { return true; } } return false; } Loading Loading @@ -4637,6 +4643,9 @@ public class PackageParser { ai.enabled = false; } ai.enabledSetting = state.enabled; if (state.protectedComponents != null) { ai.protect = state.protectedComponents.size() > 0; } } public static ApplicationInfo generateApplicationInfo(Package p, int flags, Loading Loading
core/java/android/app/ApplicationPackageManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -1609,6 +1609,15 @@ final class ApplicationPackageManager extends PackageManager { return null; } @Override public void setComponentProtectedSetting(ComponentName componentName, boolean newState) { try { mPM.setComponentProtectedSetting(componentName, newState, mContext.getUserId()); } catch (RemoteException re) { Log.e(TAG, "Failed to set component protected setting", re); } } @Override public PackageInstaller getPackageInstaller() { synchronized (mLock) { Loading
core/java/android/content/pm/ApplicationInfo.java +10 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; /** * When true, indicates that any one component within this application is * protected. * @hide */ public boolean protect = false; public void dump(Printer pw, String prefix) { super.dumpFront(pw, prefix); if (className != null) { Loading Loading @@ -709,6 +716,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { descriptionRes = orig.descriptionRes; uiOptions = orig.uiOptions; backupAgentName = orig.backupAgentName; protect = orig.protect; } Loading Loading @@ -759,6 +767,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(backupAgentName); dest.writeInt(descriptionRes); dest.writeInt(uiOptions); dest.writeInt(protect ? 1 : 0); } public static final Parcelable.Creator<ApplicationInfo> CREATOR Loading Loading @@ -808,6 +817,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { backupAgentName = source.readString(); descriptionRes = source.readInt(); uiOptions = source.readInt(); protect = source.readInt() != 0; } /** Loading
core/java/android/content/pm/IPackageManager.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -455,4 +455,8 @@ interface IPackageManager { KeySet getSigningKeySet(String packageName); boolean isPackageSignedByKeySet(String packageName, in KeySet ks); boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks); /** Protected Apps */ void setComponentProtectedSetting(in ComponentName componentName, in boolean newState, int userId); }
core/java/android/content/pm/PackageManager.java +20 −0 Original line number Diff line number Diff line Loading @@ -1686,6 +1686,20 @@ public abstract class PackageManager { public static final String EXTRA_REQUEST_PERMISSION_PERMISSION_LIST = "android.content.pm.extra.PERMISSION_LIST"; /** * Flag for {@link #setComponentProtectedSetting(android.content.ComponentName, boolean)}: * This component or application has set to protected status * @hide */ public static final boolean COMPONENT_PROTECTED_STATUS = false; /** * Flag for {@link #setComponentProtectedSetting(android.content.ComponentName, boolean)}: * This component or application has been explicitly set to visible status * @hide */ public static final boolean COMPONENT_VISIBLE_STATUS = true; /** * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides Loading Loading @@ -3896,6 +3910,12 @@ public abstract class PackageManager { + "/" + packageName; } /** * Update Component protection state * @hide */ public abstract void setComponentProtectedSetting(ComponentName componentName, boolean newState); /** * Adds a {@link CrossProfileIntentFilter}. After calling this method all intents sent from the * user with id sourceUserId can also be be resolved by activities in the user with id Loading
core/java/android/content/pm/PackageParser.java +9 −0 Original line number Diff line number Diff line Loading @@ -4604,6 +4604,12 @@ public class PackageParser { && p.usesLibraryFiles != null) { return true; } if (state.protectedComponents != null) { boolean protect = state.protectedComponents.size() > 0; if (p.applicationInfo.protect != protect) { return true; } } return false; } Loading Loading @@ -4637,6 +4643,9 @@ public class PackageParser { ai.enabled = false; } ai.enabledSetting = state.enabled; if (state.protectedComponents != null) { ai.protect = state.protectedComponents.size() > 0; } } public static ApplicationInfo generateApplicationInfo(Package p, int flags, Loading