OSDN Git Service

Make verifier device id information visible
authorKenny Root <kroot@google.com>
Sun, 25 Sep 2011 16:23:27 +0000 (09:23 -0700)
committerKenny Root <kroot@google.com>
Mon, 26 Sep 2011 16:55:03 +0000 (09:55 -0700)
This makes the verifier device identifier information for this
particular device visible in the "Development" screen of
Settings.

Bug: 5205163
Change-Id: I55e0b32fe98f898e6e8d723ce6696529fdccffd0

res/values/strings.xml
res/xml/development_prefs.xml
src/com/android/settings/DevelopmentSettings.java

index c868470..6fb9069 100644 (file)
@@ -2674,6 +2674,12 @@ found in the list of installed applications.</string>
     <string name="enable_adb">USB debugging</string>
     <!-- Setting checkbox summary for Whether to enable USB debugging support on the phone -->
     <string name="enable_adb_summary">Debug mode when USB is connected</string>
+    <!-- Development settings: title for the field that shows the "App ID" development identifier
+         for this device. [CHAR LIMIT=40] -->
+    <string name="verifier_device_identifier">Development device ID</string>
+    <!-- Development settings: a string to show when the "App ID" development identifier for this
+         device cannot be read from internal settings. [CHAR LIMIT=60] -->
+    <string name="verifier_device_identifier_not_available">Device information not available</string>
     <!-- Setting Checkbox title whether to keep the screen on when plugged in to a power source -->
     <string name="keep_screen_on">Stay awake</string>
     <!-- setting Checkbox summary whether to keep the screen on when plugged in  -->
index b65c2e5..76e50aa 100644 (file)
         android:title="@string/enable_adb" 
         android:summary="@string/enable_adb_summary"/>
 
+    <Preference
+        android:key="verifier_device_identifier"
+        style="?android:attr/preferenceInformationStyle"
+        android:title="@string/verifier_device_identifier"
+        android:summary="@string/verifier_device_identifier_not_available"
+        android:persistent="false" />
+
     <CheckBoxPreference 
         android:key="keep_screen_on" 
         android:title="@string/keep_screen_on" 
index bdbec97..c3725e4 100644 (file)
@@ -24,6 +24,8 @@ import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.VerifierDeviceIdentity;
 import android.os.BatteryManager;
 import android.os.Build;
 import android.os.Bundle;
@@ -51,6 +53,8 @@ public class DevelopmentSettings extends PreferenceFragment
                 OnPreferenceChangeListener {
 
     private static final String ENABLE_ADB = "enable_adb";
+
+    private static final String VERIFIER_DEVICE_IDENTIFIER = "verifier_device_identifier";
     private static final String KEEP_SCREEN_ON = "keep_screen_on";
     private static final String ALLOW_MOCK_LOCATION = "allow_mock_location";
     private static final String HDCP_CHECKING_KEY = "hdcp_checking";
@@ -130,6 +134,13 @@ public class DevelopmentSettings extends PreferenceFragment
         mShowAllANRs = (CheckBoxPreference) findPreference(
                 SHOW_ALL_ANRS_KEY);
 
+        final Preference verifierDeviceIdentifier = findPreference(VERIFIER_DEVICE_IDENTIFIER);
+        final PackageManager pm = getActivity().getPackageManager();
+        final VerifierDeviceIdentity verifierIndentity = pm.getVerifierDeviceIdentity();
+        if (verifierIndentity != null) {
+            verifierDeviceIdentifier.setSummary(verifierIndentity.toString());
+        }
+
         removeHdcpOptionsForProduction();
     }