OSDN Git Service

Snap for 4754571 from d940a680a51fed88e5e85e832f036adcf291911b to pi-release
authorandroid-build-team Robot <android-build-team-robot@google.com>
Tue, 1 May 2018 07:29:18 +0000 (07:29 +0000)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Tue, 1 May 2018 07:29:18 +0000 (07:29 +0000)
Change-Id: I84ad3d8e14bb9d111a9821ef50a38bf41c4c03f1

14 files changed:
AndroidManifest.xml
res/drawable/ic_find_device_disabled.xml
res/drawable/ic_find_device_enabled.xml
res/drawable/ic_ota_update_available.xml
res/drawable/ic_ota_update_current.xml
res/drawable/ic_ota_update_none.xml
res/drawable/ic_ota_update_stale.xml
res/drawable/ic_package_verifier_disabled.xml
res/drawable/ic_package_verifier_enabled.xml
res/drawable/ic_package_verifier_removed.xml
res/xml/sound_settings.xml
src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
src/com/android/settings/notification/SoundSettings.java
tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java

index aae9b83..00b2e94 100644 (file)
                 android:resource="@string/suggested_fingerprint_lock_settings_title" />
             <meta-data android:name="com.android.settings.summary"
                 android:resource="@string/suggested_fingerprint_lock_settings_summary" />
+            <meta-data android:name="com.android.settings.icon_tintable" android:value="true" />
         </activity>
 
         <activity android:name=".password.ChooseLockGeneric$InternalActivity"
index 39d4fda..21e92c9 100644 (file)
@@ -20,6 +20,6 @@
     android:viewportHeight="24">
 
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FFF44336"
         android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13C19,5.13 15.87,2 12,2zM7,9c0,-2.76 2.24,-5 5,-5s5,2.24 5,5c0,2.88 -2.88,7.19 -5,9.88C9.92,16.21 7,11.85 7,9zM11,13h2v2h-2V13zM13,6h-2v5h2V6z"/>
 </vector>
index 16f0245..614ac6d 100644 (file)
@@ -20,6 +20,6 @@
     android:viewportHeight="24">
 
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FF43A047"
         android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13C19,5.13 15.87,2 12,2zM7,9c0,-2.76 2.24,-5 5,-5s5,2.24 5,5c0,2.88 -2.88,7.19 -5,9.88C9.92,16.21 7,11.85 7,9zM14.5,9c0,1.38 -1.12,2.5 -2.5,2.5S9.5,10.38 9.5,9s1.12,-2.5 2.5,-2.5S14.5,7.62 14.5,9z"/>
 </vector>
index 2b0d82d..b03f9d7 100644 (file)
@@ -20,6 +20,6 @@
     android:viewportHeight="24">
 
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FFF44336"
         android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7zM16,12.5l-4,4l-4,-4l1.41,-1.41L11,12.67V8.5V8h2v0.5v4.17l1.59,-1.59L16,12.5z"/>
 </vector>
index e9b987a..c38a083 100644 (file)
@@ -20,6 +20,6 @@
     android:viewportHeight="24">
 
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FF43A047"
         android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7zM11.14,16l-3.84,-3.84l1.41,-1.42l2.43,2.42l4.16,-4.16l1.42,1.41L11.14,16z"/>
 </vector>
index a01a459..b49b424 100644 (file)
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-        android:pathData="M0,0l24,0l0,24l-24,0z"
-        android:strokeColor="#000000"
-        android:fillColor="#00000000"
-        android:strokeWidth="1.33333335e-11"
-        android:strokeAlpha="0.00784313771"/>
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+
     <path
-        android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3L5,21C5,22.1 5.9,23 7,23L17,23C18.1,23 19,22.1 19,21L19,3C19,1.9 18.1,1.01 17,1.01ZM17,19L7,19L7,5L17,5L17,19ZM13.143,17.714L10.857,17.714L10.857,15.429L13.143,15.429L13.143,17.714ZM13.143,13.143L10.857,13.143L10.857,6.286L13.143,6.286L13.143,13.143Z"
-        android:strokeColor="#00000000"
-        android:fillColor="#F09300"
-        android:strokeWidth="1"/>
+        android:fillColor="#FFF44336"
+        android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7zM11,15h2v2h-2V15zM13,8h-2v5h2V8z"/>
 </vector>
index 266920b..b49b424 100644 (file)
@@ -20,6 +20,6 @@
     android:viewportHeight="24">
 
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FFF44336"
         android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7zM11,15h2v2h-2V15zM13,8h-2v5h2V8z"/>
 </vector>
index 9dfcb9d..49fe0d3 100644 (file)
@@ -20,6 +20,6 @@
     android:viewportHeight="24">
 
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FFEF6C00"
         android:pathData="M12,4.24l6,3v4.1c0,3.9 -2.55,7.5 -6,8.59c-3.45,-1.09 -6,-4.7 -6,-8.59v-4.1L12,4.24M12,2L4,6v5.33c0,4.93 3.41,9.55 8,10.67c4.59,-1.12 8,-5.73 8,-10.67V6L12,2L12,2zM11,15h2v2h-2V15zM13,8h-2v5h2V8z"/>
 </vector>
index 670ede4..1e09eee 100644 (file)
@@ -20,6 +20,6 @@
     android:viewportHeight="24">
 
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FF43A047"
         android:pathData="M11.14,16l-3.84,-3.84l1.41,-1.42l2.43,2.42l4.16,-4.16l1.42,1.41L11.14,16zM12,4.24l6,3v4.1c0,3.9 -2.55,7.5 -6,8.59c-3.45,-1.09 -6,-4.7 -6,-8.59v-4.1L12,4.24M12,2L4,6v5.33c0,4.93 3.41,9.55 8,10.67c4.59,-1.12 8,-5.73 8,-10.67V6L12,2L12,2z"/>
 </vector>
index 66ad8ed..d3680e7 100644 (file)
@@ -19,6 +19,6 @@
     android:viewportWidth="24"
     android:viewportHeight="24">
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="#FFF44336"
         android:pathData="M15.5,9.91L14.09,8.5L12,10.59L9.91,8.5L8.5,9.91L10.59,12L8.5,14.09l1.41,1.41L12,13.42l2.09,2.08l1.41,-1.41L13.42,12L15.5,9.91zM12,4.24l6,3v4.1c0,3.9 -2.55,7.5 -6,8.59c-3.45,-1.09 -6,-4.7 -6,-8.59v-4.1L12,4.24M12,2L4,6v5.33c0,4.93 3.41,9.55 8,10.67c4.59,-1.12 8,-5.73 8,-10.67V6L12,2L12,2z"/>
 </vector>
index c079807..15fbcc8 100644 (file)
           android:key="screen_locking_sounds"
           android:title="@string/screen_locking_sounds_title" />
 
+        <!-- Charging sounds -->
+        <SwitchPreference
+          android:key="charging_sounds"
+          android:title="@string/charging_sounds_title" />
+
         <!-- Docking sounds -->
         <SwitchPreference
           android:key="docking_sounds"
index f403e05..6ea7fd7 100644 (file)
@@ -133,6 +133,9 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
     @Override
     public void bindPreferenceToTile(Activity activity, int sourceMetricsCategory, Preference pref,
             Tile tile, String key, int baseOrder) {
+        if (pref == null) {
+            return;
+        }
         pref.setTitle(tile.title);
         if (!TextUtils.isEmpty(key)) {
             pref.setKey(key);
@@ -239,7 +242,7 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
         if (tile.icon != null) {
             preference.setIcon(tile.icon.loadDrawable(preference.getContext()));
         } else if (tile.metaData != null
-                && tile.metaData.containsKey(META_DATA_PREFERENCE_ICON_URI))
+                && tile.metaData.containsKey(META_DATA_PREFERENCE_ICON_URI)) {
             ThreadUtils.postOnBackgroundThread(() -> {
                 String packageName = null;
                 if (tile.intent != null) {
@@ -259,11 +262,11 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
                     return;
                 }
                 final Icon icon = Icon.createWithResource(iconInfo.first, iconInfo.second);
-                ThreadUtils.postOnMainThread(() -> {
-                            preference.setIcon(icon.loadDrawable(preference.getContext()));
-                    }
+                ThreadUtils.postOnMainThread(() ->
+                        preference.setIcon(icon.loadDrawable(preference.getContext()))
                 );
             });
+        }
     }
 
     private void launchIntentOrSelectProfile(Activity activity, Tile tile, Intent intent,
index 6535812..dbf8ecf 100644 (file)
@@ -211,6 +211,8 @@ public class SoundSettings extends DashboardFragment {
                 new DialPadTonePreferenceController(context, fragment, lifecycle);
         final ScreenLockSoundPreferenceController screenLockSoundPreferenceController =
                 new ScreenLockSoundPreferenceController(context, fragment, lifecycle);
+        final ChargingSoundPreferenceController chargingSoundPreferenceController =
+                new ChargingSoundPreferenceController(context, fragment, lifecycle);
         final DockingSoundPreferenceController dockingSoundPreferenceController =
                 new DockingSoundPreferenceController(context, fragment, lifecycle);
         final TouchSoundPreferenceController touchSoundPreferenceController =
@@ -226,6 +228,7 @@ public class SoundSettings extends DashboardFragment {
 
         controllers.add(dialPadTonePreferenceController);
         controllers.add(screenLockSoundPreferenceController);
+        controllers.add(chargingSoundPreferenceController);
         controllers.add(dockingSoundPreferenceController);
         controllers.add(touchSoundPreferenceController);
         controllers.add(vibrateOnTouchPreferenceController);
@@ -236,6 +239,7 @@ public class SoundSettings extends DashboardFragment {
                 "other_sounds_and_vibrations_category").setChildren(
                 Arrays.asList(dialPadTonePreferenceController,
                         screenLockSoundPreferenceController,
+                        chargingSoundPreferenceController,
                         dockingSoundPreferenceController,
                         touchSoundPreferenceController,
                         vibrateOnTouchPreferenceController,
index a0e5ed8..41d8b18 100644 (file)
@@ -24,6 +24,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 import static org.robolectric.Shadows.shadowOf;
 
@@ -215,6 +216,15 @@ public class DashboardFeatureProviderImplTest {
     }
 
     @Test
+    public void bindPreference_nullPreference_shouldIgnore() {
+        final Tile tile = mock(Tile.class);
+        mImpl.bindPreferenceToTile(mActivity, MetricsProto.MetricsEvent.VIEW_UNKNOWN,
+                null, tile, "123", Preference.DEFAULT_ORDER);
+
+        verifyZeroInteractions(tile);
+    }
+
+    @Test
     public void bindPreference_withNullKeyNullPriority_shouldGenerateKeyAndPriority() {
         final Preference preference = new Preference(RuntimeEnvironment.application);
         final Tile tile = new Tile();