Settings should be per-profile

Also, don't show keyguard option for work profile

Fixes: 129905061

Test: Builds
Change-Id: I18f573f39ee4e54a3385cc65079bb794633cc560
This commit is contained in:
Kevin Chyn
2019-04-03 19:47:31 -07:00
parent 39ca021586
commit e596ba6863
8 changed files with 92 additions and 38 deletions

View File

@@ -31,9 +31,9 @@ import com.android.settings.core.TogglePreferenceController;
* Preference controller for Face settings page controlling the ability to unlock the phone
* with face.
*/
public class FaceSettingsKeyguardPreferenceController extends TogglePreferenceController {
public class FaceSettingsKeyguardPreferenceController extends FaceSettingsPreferenceController {
private static final String KEY = "security_settings_face_keyguard";
static final String KEY = "security_settings_face_keyguard";
private static final int ON = 1;
private static final int OFF = 0;
@@ -54,14 +54,14 @@ public class FaceSettingsKeyguardPreferenceController extends TogglePreferenceCo
} else if (adminDisabled()) {
return false;
}
return Settings.Secure.getInt(
mContext.getContentResolver(), FACE_UNLOCK_KEYGUARD_ENABLED, DEFAULT) == ON;
return Settings.Secure.getIntForUser(mContext.getContentResolver(),
FACE_UNLOCK_KEYGUARD_ENABLED, DEFAULT, getUserId()) == ON;
}
@Override
public boolean setChecked(boolean isChecked) {
return Settings.Secure.putInt(mContext.getContentResolver(), FACE_UNLOCK_KEYGUARD_ENABLED,
isChecked ? ON : OFF);
return Settings.Secure.putIntForUser(mContext.getContentResolver(),
FACE_UNLOCK_KEYGUARD_ENABLED, isChecked ? ON : OFF, getUserId());
}
@Override