Loading packages/SettingsLib/src/com/android/settingslib/Utils.java +13 −2 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ public class Utils { * Determine whether a package is a "system package", in which case certain things (like * disabling notifications or disabling the package altogether) should be disallowed. */ public static boolean isSystemPackage(PackageManager pm, PackageInfo pkg) { public static boolean isSystemPackage(Resources resources, PackageManager pm, PackageInfo pkg) { if (sSystemSignature == null) { sSystemSignature = new Signature[]{ getSystemSignature(pm) }; } Loading @@ -187,7 +187,8 @@ public class Utils { || pkg.packageName.equals(sPermissionControllerPackageName) || pkg.packageName.equals(sServicesSystemSharedLibPackageName) || pkg.packageName.equals(sSharedSystemSharedLibPackageName) || pkg.packageName.equals(PrintManager.PRINT_SPOOLER_PACKAGE_NAME); || pkg.packageName.equals(PrintManager.PRINT_SPOOLER_PACKAGE_NAME) || isDeviceProvisioningPackage(resources, pkg.packageName); } private static Signature getFirstSignature(PackageInfo pkg) { Loading @@ -205,4 +206,14 @@ public class Utils { } return null; } /** * Returns {@code true} if the supplied package is the device provisioning app. Otherwise, * returns {@code false}. */ public static boolean isDeviceProvisioningPackage(Resources resources, String packageName) { String deviceProvisioningPackage = resources.getString( com.android.internal.R.string.config_deviceProvisioningPackage); return deviceProvisioningPackage != null && deviceProvisioningPackage.equals(packageName); } } packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java +1 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab try { final PackageInfo info = pm.getPackageInfo(sbn.getPackageName(), PackageManager.GET_SIGNATURES); systemApp = Utils.isSystemPackage(pm, info); systemApp = Utils.isSystemPackage(getResources(), pm, info); } catch (PackageManager.NameNotFoundException e) { // unlikely. } Loading Loading
packages/SettingsLib/src/com/android/settingslib/Utils.java +13 −2 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ public class Utils { * Determine whether a package is a "system package", in which case certain things (like * disabling notifications or disabling the package altogether) should be disallowed. */ public static boolean isSystemPackage(PackageManager pm, PackageInfo pkg) { public static boolean isSystemPackage(Resources resources, PackageManager pm, PackageInfo pkg) { if (sSystemSignature == null) { sSystemSignature = new Signature[]{ getSystemSignature(pm) }; } Loading @@ -187,7 +187,8 @@ public class Utils { || pkg.packageName.equals(sPermissionControllerPackageName) || pkg.packageName.equals(sServicesSystemSharedLibPackageName) || pkg.packageName.equals(sSharedSystemSharedLibPackageName) || pkg.packageName.equals(PrintManager.PRINT_SPOOLER_PACKAGE_NAME); || pkg.packageName.equals(PrintManager.PRINT_SPOOLER_PACKAGE_NAME) || isDeviceProvisioningPackage(resources, pkg.packageName); } private static Signature getFirstSignature(PackageInfo pkg) { Loading @@ -205,4 +206,14 @@ public class Utils { } return null; } /** * Returns {@code true} if the supplied package is the device provisioning app. Otherwise, * returns {@code false}. */ public static boolean isDeviceProvisioningPackage(Resources resources, String packageName) { String deviceProvisioningPackage = resources.getString( com.android.internal.R.string.config_deviceProvisioningPackage); return deviceProvisioningPackage != null && deviceProvisioningPackage.equals(packageName); } }
packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java +1 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab try { final PackageInfo info = pm.getPackageInfo(sbn.getPackageName(), PackageManager.GET_SIGNATURES); systemApp = Utils.isSystemPackage(pm, info); systemApp = Utils.isSystemPackage(getResources(), pm, info); } catch (PackageManager.NameNotFoundException e) { // unlikely. } Loading