Add remaining whitelisted controllers
Because I missed them in the long whitelist the first time... Change-Id: I9fbd7b33e06b3f2f6e5e5778f78abfdb1a52006a Merged-In: I01c8c80fe306667c1d3ac007b16fad546c5a5f40 Fixes: 79779103 Test: robotests
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
android:key="smart_battery"
|
||||
android:title="@string/smart_battery_title"
|
||||
android:summary="@string/smart_battery_summary"
|
||||
settings:controller="com.android.settings.fuelgauge.SmartBatteryPreferenceController"
|
||||
settings:allowDividerAbove="true"/>
|
||||
|
||||
<SwitchPreference
|
||||
|
@@ -17,6 +17,7 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
@@ -61,6 +62,12 @@ public class MagnificationGesturesPreferenceController extends TogglePreferenceC
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(),
|
||||
"screen_magnification_gestures_preference_screen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
int resId = 0;
|
||||
|
@@ -17,6 +17,7 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
@@ -68,6 +69,12 @@ public class MagnificationNavbarPreferenceController extends TogglePreferenceCon
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(),
|
||||
"screen_magnification_navbar_preference_screen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
int resId = 0;
|
||||
|
@@ -21,6 +21,7 @@ import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
@@ -48,6 +49,11 @@ public class SmartBatteryPreferenceController extends BasePreferenceController i
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(), "smart_battery");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
|
@@ -18,6 +18,7 @@ package com.android.settings.notification;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
@@ -36,6 +37,11 @@ public class AlarmVolumePreferenceController extends
|
||||
&& !mHelper.isSingleVolume() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(), "alarm_volume");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return KEY_ALARM_VOLUME;
|
||||
|
@@ -114,4 +114,19 @@ public class MagnificationGesturesPreferenceControllerTest {
|
||||
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, -1))
|
||||
.isEqualTo(OFF);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceableCorrectKey_returnsTrue() {
|
||||
final MagnificationGesturesPreferenceController controller =
|
||||
new MagnificationGesturesPreferenceController(mContext,
|
||||
"screen_magnification_gestures_preference_screen");
|
||||
assertThat(controller.isSliceable()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceableIncorrectKey_returnsFalse() {
|
||||
final MagnificationGesturesPreferenceController controller =
|
||||
new MagnificationGesturesPreferenceController(mContext, "bad_key");
|
||||
assertThat(controller.isSliceable()).isFalse();
|
||||
}
|
||||
}
|
||||
|
@@ -158,4 +158,19 @@ public class MagnificationNavbarPreferenceControllerTest {
|
||||
sIsApplicable = applicable;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceableCorrectKey_returnsTrue() {
|
||||
final MagnificationNavbarPreferenceController controller =
|
||||
new MagnificationNavbarPreferenceController(mContext,
|
||||
"screen_magnification_navbar_preference_screen");
|
||||
assertThat(controller.isSliceable()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceableIncorrectKey_returnsFalse() {
|
||||
final MagnificationNavbarPreferenceController controller =
|
||||
new MagnificationNavbarPreferenceController(mContext, "bad_key");
|
||||
assertThat(controller.isSliceable()).isFalse();
|
||||
}
|
||||
}
|
||||
|
@@ -115,4 +115,11 @@ public class SmartBatteryPreferenceControllerTest {
|
||||
return Settings.Global.getInt(mContentResolver,
|
||||
Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, ON);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceableCorrectKey_returnsTrue() {
|
||||
final SmartBatteryPreferenceController controller =
|
||||
new SmartBatteryPreferenceController(mContext);
|
||||
assertThat(controller.isSliceable()).isTrue();
|
||||
}
|
||||
}
|
||||
|
@@ -73,4 +73,9 @@ public class AlarmVolumePreferenceControllerTest {
|
||||
public void getAudioStream_shouldReturnAlarm() {
|
||||
assertThat(mController.getAudioStream()).isEqualTo(AudioManager.STREAM_ALARM);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceableCorrectKey_returnsTrue() {
|
||||
assertThat(mController.isSliceable()).isTrue();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user