OSDN Git Service

Create FEATURE_ constants for print and backup
authorAdam Lesinski <adamlesinski@google.com>
Tue, 18 Feb 2014 22:05:14 +0000 (14:05 -0800)
committerAdam Lesinski <adamlesinski@google.com>
Tue, 18 Feb 2014 22:33:00 +0000 (14:33 -0800)
Bug:13079822

Change-Id: I6f4b759951d45989e8aad4011fae431ee2ecae0c

api/current.txt
core/java/android/content/pm/PackageManager.java
services/java/com/android/server/SystemServer.java

index 42a96a7..d0bf458 100644 (file)
@@ -7290,6 +7290,7 @@ package android.content.pm {
     field public static final java.lang.String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
     field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
     field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
+    field public static final java.lang.String FEATURE_BACKUP = "android.software.backup";
     field public static final java.lang.String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
     field public static final java.lang.String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le";
     field public static final java.lang.String FEATURE_CAMERA = "android.hardware.camera";
@@ -7311,6 +7312,7 @@ package android.content.pm {
     field public static final java.lang.String FEATURE_MICROPHONE = "android.hardware.microphone";
     field public static final java.lang.String FEATURE_NFC = "android.hardware.nfc";
     field public static final java.lang.String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce";
+    field public static final java.lang.String FEATURE_PRINTING = "android.software.print";
     field public static final java.lang.String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape";
     field public static final java.lang.String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait";
     field public static final java.lang.String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer";
index c97c2b8..485ee68 100644 (file)
@@ -1249,6 +1249,20 @@ public abstract class PackageManager {
     public static final String FEATURE_TELEVISION = "android.hardware.type.television";
 
     /**
+     * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
+     * The device supports printing.
+     */
+    @SdkConstant(SdkConstantType.FEATURE)
+    public static final String FEATURE_PRINTING = "android.software.print";
+
+    /**
+     * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
+     * The device can perform backup and restore operations on installed applications.
+     */
+    @SdkConstant(SdkConstantType.FEATURE)
+    public static final String FEATURE_BACKUP = "android.software.backup";
+
+    /**
      * Action to external storage service to clean out removed apps.
      * @hide
      */
index dfcdb9a..afd7845 100644 (file)
@@ -533,7 +533,7 @@ public final class SystemServer {
                 }
 
                 try {
-                    if (pm.hasSystemFeature("android.software.device_admin")) {
+                    if (pm.hasSystemFeature(PackageManager.FEATURE_DEVICE_ADMIN)) {
                         mSystemServiceManager.startServiceIfExists(
                                 DEVICE_POLICY_MANAGER_SERVICE_CLASS);
                     }
@@ -785,7 +785,7 @@ public final class SystemServer {
 
             if (!disableNonCoreServices) {
                 try {
-                    if (pm.hasSystemFeature("android.software.backup")) {
+                    if (pm.hasSystemFeature(PackageManager.FEATURE_BACKUP)) {
                         mSystemServiceManager.startServiceIfExists(BACKUP_MANAGER_SERVICE_CLASS);
                     }
                 } catch (Throwable e) {
@@ -793,7 +793,7 @@ public final class SystemServer {
                 }
 
                 try {
-                    if (pm.hasSystemFeature("android.software.app_widgets")) {
+                    if (pm.hasSystemFeature(PackageManager.FEATURE_APP_WIDGETS)) {
                         mSystemServiceManager.startServiceIfExists(APPWIDGET_SERVICE_CLASS);
                     }
                 } catch (Throwable e) {
@@ -879,7 +879,7 @@ public final class SystemServer {
             }
 
             try {
-                if (pm.hasSystemFeature("android.software.print")) {
+                if (pm.hasSystemFeature(PackageManager.FEATURE_PRINTING)) {
                     mSystemServiceManager.startServiceIfExists(PRINT_MANAGER_SERVICE_CLASS);
                 }
             } catch (Throwable e) {