Add highlight menu keys for all toggle pref controllers and custom slices
Bug: 204695404 Test: manual, robotest build pass, unit Change-Id: Iad2e28ada8ddb766ffa7eff2c8dc581250cbd6f8
This commit is contained in:
@@ -67,6 +67,11 @@ public class BluetoothScanningMainSwitchPreferenceController extends TogglePrefe
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
return R.string.menu_key_location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchChanged(Switch switchView, boolean isChecked) {
|
||||
if (isChecked != isChecked()) {
|
||||
|
@@ -20,6 +20,7 @@ import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.provider.DeviceConfig;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
|
||||
@@ -54,4 +55,9 @@ public class LocationIndicatorsPreferenceController extends TogglePreferenceCont
|
||||
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION)
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
return R.string.menu_key_location;
|
||||
}
|
||||
}
|
||||
|
@@ -88,11 +88,16 @@ public class LocationSlice implements CustomSliceable {
|
||||
final Uri contentUri = new Uri.Builder().appendPath(KEY_LOCATION).build();
|
||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||
LocationSettings.class.getName(), KEY_LOCATION, screenTitle,
|
||||
SettingsEnums.LOCATION)
|
||||
SettingsEnums.LOCATION, this)
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||
.setData(contentUri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
return R.string.menu_key_location;
|
||||
}
|
||||
|
||||
private PendingIntent getPrimaryAction() {
|
||||
final Intent intent = getIntent();
|
||||
return PendingIntent.getActivity(mContext, 0 /* requestCode */,
|
||||
|
@@ -68,6 +68,11 @@ public class WifiScanningMainSwitchPreferenceController extends TogglePreference
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSliceHighlightMenuRes() {
|
||||
return R.string.menu_key_location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchChanged(Switch switchView, boolean isChecked) {
|
||||
if (isChecked != isChecked()) {
|
||||
|
Reference in New Issue
Block a user