diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d115a40c881..9beec69031c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1863,39 +1863,39 @@
diff --git a/res/drawable/ic_storage_wizard_external.xml b/res/drawable/ic_storage_wizard_external.xml
index c11334d5893..99e2698633d 100644
--- a/res/drawable/ic_storage_wizard_external.xml
+++ b/res/drawable/ic_storage_wizard_external.xml
@@ -19,71 +19,75 @@
android:viewportWidth="144.0"
android:viewportHeight="144.0">
+
+ android:pathData="M74,89L74,95L119.11,95L121.99,89L74,89ZM73,87L122.59,87C122.26,87.73 120.83,90.87 118.29,96.42C118.13,96.77 117.77,97 117.38,97L73,97C72.45,97 72,96.55 72,96L72,88C72,87.45 72.45,87 73,87Z"
+ android:strokeColor="#00000000"
+ android:fillType="nonZero"
+ android:fillColor="#DADCE0"
+ android:strokeWidth="1"/>
+ android:pathData="M89,87L122.96,87C126.83,74.93 128.26,64.56 127.26,55.89C126.26,47.22 122.76,38.26 116.78,29L89,29L89,87ZM89,27L115.53,27C116.63,27 128.29,48.2 127.36,60.95C125.65,84.63 123.1,89 122,89L87,89L87,29C87,27.9 87.9,27 89,27Z"
+ android:strokeColor="#00000000"
+ android:fillType="nonZero"
+ android:fillColor="#DADCE0"
+ android:strokeWidth="1"/>
+ android:pathData="M64,126.08C98.29,126.08 126.08,98.29 126.08,64C126.08,29.71 98.29,1.92 64,1.92C29.71,1.92 1.92,29.71 1.92,64C1.92,98.29 29.71,126.08 64,126.08ZM64,128C28.65,128 0,99.35 0,64C0,28.65 28.65,0 64,0C99.35,0 128,28.65 128,64C128,99.35 99.35,128 64,128Z"
+ android:strokeColor="#00000000"
+ android:fillType="nonZero"
+ android:fillColor="#DADCE0"
+ android:strokeWidth="1"/>
diff --git a/res/drawable/ic_storage_wizard_internal.xml b/res/drawable/ic_storage_wizard_internal.xml
index f6c660b1efd..41768f7727d 100644
--- a/res/drawable/ic_storage_wizard_internal.xml
+++ b/res/drawable/ic_storage_wizard_internal.xml
@@ -14,60 +14,60 @@
limitations under the License.
-->
+ android:width="144dp"
+ android:height="144dp"
+ android:viewportWidth="144.0"
+ android:viewportHeight="144.0">
+
+ android:strokeWidth="1"/>
+ android:strokeWidth="1"/>
+ android:strokeWidth="1"/>
Update available
- Can’t change this setting
+ Action not allowed
Can’t change volume
diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml
index 612f5e7623b..291d9a8da6d 100644
--- a/res/xml/configure_notification_settings.xml
+++ b/res/xml/configure_notification_settings.xml
@@ -28,7 +28,8 @@
+ android:title="@string/notification_badging_title"
+ settings:controller="com.android.settings.notification.BadgingNotificationPreferenceController"/>
buildPreferenceControllers(Context context,
Lifecycle lifecycle, Application app, Fragment host) {
final List controllers = new ArrayList<>();
- final BadgingNotificationPreferenceController badgeController =
- new BadgingNotificationPreferenceController(context);
final PulseNotificationPreferenceController pulseController =
new PulseNotificationPreferenceController(context);
final LockScreenNotificationPreferenceController lockScreenNotificationController =
@@ -108,7 +106,6 @@ public class ConfigureNotificationSettings extends DashboardFragment {
}
controllers.add(new RecentNotifyingAppsPreferenceController(
context, new NotificationBackend(), app, host));
- controllers.add(badgeController);
controllers.add(pulseController);
controllers.add(lockScreenNotificationController);
controllers.add(new NotificationRingtonePreferenceController(context) {
diff --git a/src/com/android/settings/notification/ZenCustomRadioButtonPreference.java b/src/com/android/settings/notification/ZenCustomRadioButtonPreference.java
index 6035b49859a..91472f95244 100644
--- a/src/com/android/settings/notification/ZenCustomRadioButtonPreference.java
+++ b/src/com/android/settings/notification/ZenCustomRadioButtonPreference.java
@@ -86,10 +86,13 @@ public class ZenCustomRadioButtonPreference extends TwoTargetPreference
}
final View gear = holder.findViewById(android.R.id.widget_frame);
+ final View divider = holder.findViewById(R.id.two_target_divider);
if (mOnGearClickListener != null) {
+ divider.setVisibility(View.VISIBLE);
gear.setVisibility(View.VISIBLE);
gear.setOnClickListener(this);
} else {
+ divider.setVisibility(View.GONE);
gear.setVisibility(View.GONE);
gear.setOnClickListener(null);
}
diff --git a/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java
index d852aaa5b3e..f9991949e47 100644
--- a/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BadgingNotificationPreferenceControllerTest.java
@@ -17,6 +17,12 @@
package com.android.settings.notification;
import static android.provider.Settings.Secure.NOTIFICATION_BADGING;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.DISABLED_UNSUPPORTED;
+import static com.android.settings.notification.BadgingNotificationPreferenceController.OFF;
+import static com.android.settings.notification.BadgingNotificationPreferenceController.ON;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -54,10 +60,13 @@ public class BadgingNotificationPreferenceControllerTest {
private BadgingNotificationPreferenceController mController;
private Preference mPreference;
+ private static final String KEY_NOTIFICATION_BADGING = "notification_badging";
+
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- mController = new BadgingNotificationPreferenceController(mContext);
+ mController = new BadgingNotificationPreferenceController(mContext,
+ KEY_NOTIFICATION_BADGING);
mPreference = new Preference(RuntimeEnvironment.application);
mPreference.setKey(mController.getPreferenceKey());
when(mScreen.findPreference(mPreference.getKey())).thenReturn(mPreference);
@@ -88,9 +97,10 @@ public class BadgingNotificationPreferenceControllerTest {
public void updateState_preferenceSetCheckedWhenSettingIsOn() {
final TwoStatePreference preference = mock(TwoStatePreference.class);
final Context context = RuntimeEnvironment.application;
- Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BADGING, 1);
+ Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BADGING, ON);
- mController = new BadgingNotificationPreferenceController(context);
+ mController = new BadgingNotificationPreferenceController(context,
+ KEY_NOTIFICATION_BADGING);
mController.updateState(preference);
verify(preference).setChecked(true);
@@ -100,9 +110,10 @@ public class BadgingNotificationPreferenceControllerTest {
public void updateState_preferenceSetUncheckedWhenSettingIsOff() {
final TwoStatePreference preference = mock(TwoStatePreference.class);
final Context context = RuntimeEnvironment.application;
- Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BADGING, 0);
+ Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BADGING, OFF);
- mController = new BadgingNotificationPreferenceController(context);
+ mController = new BadgingNotificationPreferenceController(context,
+ KEY_NOTIFICATION_BADGING);
mController.updateState(preference);
verify(preference).setChecked(false);
@@ -118,11 +129,11 @@ public class BadgingNotificationPreferenceControllerTest {
public void testSetValue_updatesCorrectly() {
final int newValue = 0;
ContentResolver resolver = mContext.getContentResolver();
- Settings.Secure.putInt(resolver, Settings.Secure.NOTIFICATION_BADGING, 1);
+ Settings.Secure.putInt(resolver, Settings.Secure.NOTIFICATION_BADGING, ON);
((InlinePayload) mController.getResultPayload()).setValue(mContext, newValue);
final int updatedValue =
- Settings.Secure.getInt(resolver, Settings.Secure.NOTIFICATION_BADGING, 1);
+ Settings.Secure.getInt(resolver, Settings.Secure.NOTIFICATION_BADGING, ON);
assertThat(updatedValue).isEqualTo(newValue);
}
@@ -138,4 +149,40 @@ public class BadgingNotificationPreferenceControllerTest {
assertThat(newValue).isEqualTo(currentValue);
}
+
+ @Test
+ public void isChecked_settingIsOff_shouldReturnFalse() {
+ Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BADGING, OFF);
+
+ assertThat(mController.isChecked()).isFalse();
+ }
+
+ @Test
+ public void isChecked_settingIsOn_shouldReturnTrue() {
+ Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BADGING, ON);
+
+ assertThat(mController.isChecked()).isTrue();
+ }
+
+ @Test
+ public void setChecked_setFalse_disablesSetting() {
+ Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BADGING, ON);
+
+ mController.setChecked(false);
+ int updatedValue = Settings.Secure.getInt(mContext.getContentResolver(),
+ NOTIFICATION_BADGING, -1);
+
+ assertThat(updatedValue).isEqualTo(OFF);
+ }
+
+ @Test
+ public void setChecked_setTrue_enablesSetting() {
+ Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BADGING, OFF);
+
+ mController.setChecked(true);
+ int updatedValue = Settings.Secure.getInt(mContext.getContentResolver(),
+ NOTIFICATION_BADGING, -1);
+
+ assertThat(updatedValue).isEqualTo(ON);
+ }
}