OSDN Git Service

merge in lmp-mr1-release history after reset to lmp-mr1-dev
authorThe Android Automerger <android-build@google.com>
Wed, 7 Jan 2015 14:10:34 +0000 (06:10 -0800)
committerThe Android Automerger <android-build@google.com>
Wed, 7 Jan 2015 14:10:34 +0000 (06:10 -0800)
res/values/strings.xml
res/xml/device_info_settings.xml
src/com/android/settings/DeviceInfoSettings.java
src/com/android/settings/TrustedCredentialsSettings.java

index 58b8b8e..10f289c 100644 (file)
     <!-- Note: this may be replaced by a more-specific title of the activity that will get launched --> <skip />
     <!-- About phone settings screen, setting option name to see terms and conditions -->
     <string name="terms_title">Terms and conditions</string>
+    <!-- Note: this may be replaced by a more-specific title of the activity that will get launched --> <skip />
+    <!-- About phone settings screen, setting option name to see licensing info for WebView component. [CHAR LIMIT=35] -->
+    <string name="webview_license_title">System WebView License</string>
     <!-- About phone settings screen, setting option name to see wallpapers attributions -->
     <string name="wallpaper_attributions">Wallpapers</string>
     <!-- About phone settings screen, setting option name to see wallpapers attributions values -->
index 45eda60..46992a4 100644 (file)
                 <intent android:action="android.settings.TERMS" />
             </PreferenceScreen>
 
+            <!-- System WebView License information -->
+            <PreferenceScreen
+                    android:key="webview_license"
+                    android:title="@string/webview_license_title">
+                <intent android:action="android.settings.WEBVIEW_LICENSE" />
+            </PreferenceScreen>
+
             <Preference
                     android:key="wallpaper_attributions"
                     android:title="@string/wallpaper_attributions"
index b6d8fef..f79707a 100644 (file)
@@ -64,6 +64,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
     private static final String KEY_TERMS = "terms";
     private static final String KEY_LICENSE = "license";
     private static final String KEY_COPYRIGHT = "copyright";
+    private static final String KEY_WEBVIEW_LICENSE = "webview_license";
     private static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings";
     private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
     private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux";
@@ -144,6 +145,8 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
                 Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
         Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_COPYRIGHT,
                 Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
+        Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_WEBVIEW_LICENSE,
+                Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
 
         // These are contained by the root preference screen
         parentPreference = getPreferenceScreen();
@@ -448,6 +451,9 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
                 if (!checkIntentAction(context, "android.settings.COPYRIGHT")) {
                     keys.add(KEY_COPYRIGHT);
                 }
+                if (!checkIntentAction(context, "android.settings.WEBVIEW_LICENSE")) {
+                    keys.add(KEY_WEBVIEW_LICENSE);
+                }
                 if (UserHandle.myUserId() != UserHandle.USER_OWNER) {
                     keys.add(KEY_SYSTEM_UPDATE_SETTINGS);
                 }
index 31ce975..e2b49d6 100644 (file)
@@ -620,6 +620,9 @@ public class TrustedCredentialsSettings extends Fragment {
         holder.mSubjectSecondaryView.setText(certHolder.mSubjectSecondary);
         if (mTab.mSwitch) {
             holder.mSwitch.setChecked(!certHolder.mDeleted);
+            holder.mSwitch.setEnabled(!mUserManager.hasUserRestriction(
+                    UserManager.DISALLOW_CONFIG_CREDENTIALS,
+                    new UserHandle(certHolder.mProfileId)));
             holder.mSwitch.setVisibility(View.VISIBLE);
         }
         return convertView;
@@ -680,7 +683,8 @@ public class TrustedCredentialsSettings extends Fragment {
         Button removeButton = (Button) inflater.inflate(R.layout.trusted_credential_details,
                                                         body,
                                                         false);
-        if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) {
+        if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS,
+                new UserHandle(certHolder.mProfileId))) {
             body.addView(removeButton);
         }
         removeButton.setText(certHolder.mTab.getButtonLabel(certHolder));
@@ -764,17 +768,11 @@ public class TrustedCredentialsSettings extends Fragment {
                 } else {
                     return service.deleteCaCertificate(mCertHolder.mAlias);
                 }
-            } catch (CertificateEncodingException e) {
+            } catch (CertificateEncodingException | SecurityException | IllegalStateException
+                    | RemoteException e) {
                 Log.w(TAG, "Error while toggling alias " + mCertHolder.mAlias,
                         e);
                 return false;
-            } catch (IllegalStateException e) {
-                // used by installCaCertificate to report errors
-                Log.w(TAG, "Error while toggling alias " + mCertHolder.mAlias, e);
-                return false;
-            } catch (RemoteException e) {
-                Log.w(TAG, "Error while toggling alias " + mCertHolder.mAlias, e);
-                return false;
             }
         }