Importance slide updates.

- Make settings match systemui
- prevent users from blocking system notification topics, and
share said code with systemui

Bug: 26575595
Change-Id: I3911046e2f96897b26b9b9597835a8d7b771996f
This commit is contained in:
Julia Reynolds
2016-01-15 14:23:13 -05:00
parent 15603c0b01
commit c9a1884ed8
6 changed files with 41 additions and 51 deletions

View File

@@ -34,11 +34,8 @@ import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
import android.content.pm.IntentFilterVerificationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.pm.Signature;
import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
@@ -707,35 +704,6 @@ public final class Utils extends com.android.settingslib.Utils {
return tm.getSimCount() > 1;
}
/**
* 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) {
if (sSystemSignature == null) {
sSystemSignature = new Signature[]{ getSystemSignature(pm) };
}
return sSystemSignature[0] != null && sSystemSignature[0].equals(getFirstSignature(pkg));
}
private static Signature[] sSystemSignature;
private static Signature getFirstSignature(PackageInfo pkg) {
if (pkg != null && pkg.signatures != null && pkg.signatures.length > 0) {
return pkg.signatures[0];
}
return null;
}
private static Signature getSystemSignature(PackageManager pm) {
try {
final PackageInfo sys = pm.getPackageInfo("android", PackageManager.GET_SIGNATURES);
return getFirstSignature(sys);
} catch (NameNotFoundException e) {
}
return null;
}
/**
* Returns elapsed time for the given millis, in the following format:
* 2d 5h 40m 29s