diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/ApplicationContext.java | 9 | ||||
-rw-r--r-- | core/java/android/content/pm/IPackageManager.aidl | 2 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageManager.java | 10 |
3 files changed, 20 insertions, 1 deletions
diff --git a/core/java/android/app/ApplicationContext.java b/core/java/android/app/ApplicationContext.java index 8896015..0582e34 100644 --- a/core/java/android/app/ApplicationContext.java +++ b/core/java/android/app/ApplicationContext.java @@ -1686,6 +1686,15 @@ class ApplicationContext extends Context { } @Override + public boolean hasSystemFeature(String name) { + try { + return mPM.hasSystemFeature(name); + } catch (RemoteException e) { + throw new RuntimeException("Package manager has died", e); + } + } + + @Override public int checkPermission(String permName, String pkgName) { try { return mPM.checkPermission(permName, pkgName); diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index c322951..fc6538f 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -283,6 +283,8 @@ interface IPackageManager { */ FeatureInfo[] getSystemAvailableFeatures(); + boolean hasSystemFeature(String name); + void enterSafeMode(); boolean isSafeMode(); void systemReady(); diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 825eb85..cd48dcb 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -995,11 +995,19 @@ public abstract class PackageManager { * * @return An array of FeatureInfo classes describing the features * that are available on the system, or null if there are none(!!). - * */ public abstract FeatureInfo[] getSystemAvailableFeatures(); /** + * Check whether the given feature name is one of the available + * features as returned by {@link #getSystemAvailableFeatures()}. + * + * @return Returns true if the devices supports the feature, else + * false. + */ + public abstract boolean hasSystemFeature(String name); + + /** * Determine the best action to perform for a given Intent. This is how * {@link Intent#resolveActivity} finds an activity if a class has not * been explicitly specified. |