Refactor LocationSettings
- Extends BasePreferenceController in LocationBasePreferenceController which binds preference key based on xml file instead of writing the key in java code. Then the controller can be used in many xmls. - Modify LocationServicePreferenceController to support only personal or profile user. Bug: 141601408 Test: manual, robolectric Change-Id: I51ee950dfb87474df84a8dc3db55fb911edcf599
This commit is contained in:
@@ -19,19 +19,14 @@ package com.android.settings.location;
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
|
||||
public class LocationScanningPreferenceController extends BasePreferenceController {
|
||||
@VisibleForTesting static final String KEY_LOCATION_SCANNING = "location_scanning";
|
||||
private final Context mContext;
|
||||
|
||||
public LocationScanningPreferenceController(Context context) {
|
||||
super(context, KEY_LOCATION_SCANNING);
|
||||
mContext = context;
|
||||
public LocationScanningPreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user