diff options
author | Steve Kondik <steve@cyngn.com> | 2015-02-18 03:44:31 -0800 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-29 17:36:30 -0700 |
commit | e65f2833df18e755c847bc86376253a4b96e73f9 (patch) | |
tree | e61b573057968f05218a0ad697dd38183bf81149 /src/com/android/settings/Utils.java | |
parent | 8f57a61603b7bc2fca99a510cb6c8188fb9612d2 (diff) | |
download | packages_apps_Settings-e65f2833df18e755c847bc86376253a4b96e73f9.zip packages_apps_Settings-e65f2833df18e755c847bc86376253a4b96e73f9.tar.gz packages_apps_Settings-e65f2833df18e755c847bc86376253a4b96e73f9.tar.bz2 |
livedisplay: Add LiveDisplay settings
* Add preference for LiveDisplay mode, and additional supporting
options for auto mode.
* CABC, SRE, CE are all under this umbrella now.
* Manual RGB tweaking is now handled here and the requirement for
CMHW has been removed as it will go thru RenderEngine.
* Moved all related code into the livedisplay package.
Change-Id: I0b00f2bfd8f8227d64ad271bbe0f004f0b4bcf9d
Diffstat (limited to 'src/com/android/settings/Utils.java')
-rw-r--r-- | src/com/android/settings/Utils.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java index 0834c8d..4e945ef 100644 --- a/src/com/android/settings/Utils.java +++ b/src/com/android/settings/Utils.java @@ -760,6 +760,25 @@ public final class Utils { return (deviceKeys & ButtonSettings.KEY_MASK_VOLUME) != 0; } + public static boolean isPackageInstalled(Context context, String pkg, boolean ignoreState) { + if (pkg != null) { + try { + PackageInfo pi = context.getPackageManager().getPackageInfo(pkg, 0); + if (!pi.applicationInfo.enabled && !ignoreState) { + return false; + } + } catch (NameNotFoundException e) { + return false; + } + } + + return true; + } + + public static boolean isPackageInstalled(Context context, String pkg) { + return isPackageInstalled(context, pkg, true); + } + /** * Start a new instance of the activity, showing only the given fragment. * When launched in this mode, the given preference fragment will be instantiated and fill the |