Enable controllers to use a custom key.

Test: atest SettingsUnitTests
Test: m -j45 RunSettingsRoboTests
Bug: 191763369
Change-Id: I48eea95613600580c80c8850f0a3fd543a7e0a43
This commit is contained in:
Jan Tomljanovic
2021-06-25 01:45:30 +01:00
parent 37b1831d0d
commit c6667337ca
18 changed files with 171 additions and 27 deletions

View File

@@ -37,9 +37,17 @@ public class ChangeProfileScreenLockPreferenceController extends
private static final String KEY_UNLOCK_SET_OR_CHANGE_PROFILE = "unlock_set_or_change_profile";
private final String mPreferenceKey;
public ChangeProfileScreenLockPreferenceController(Context context,
SettingsPreferenceFragment host) {
this(context, host, KEY_UNLOCK_SET_OR_CHANGE_PROFILE);
}
public ChangeProfileScreenLockPreferenceController(Context context,
SettingsPreferenceFragment host, String key) {
super(context, host);
this.mPreferenceKey = key;
}
public boolean isAvailable() {
@@ -65,7 +73,7 @@ public class ChangeProfileScreenLockPreferenceController extends
@Override
public String getPreferenceKey() {
return KEY_UNLOCK_SET_OR_CHANGE_PROFILE;
return mPreferenceKey;
}
@Override