[automerger] DO NOT MERGE Disable changing lock when device is not provisioned. am: c624deaff5
am: c056ac3011
am: 782fc16dc4
Change-Id: Ic801ec29d08cf8600e3f04cd9b311d6fbbb315a8
This commit is contained in:
@@ -140,6 +140,11 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
final Activity activity = getActivity();
|
||||
if (!Utils.isDeviceProvisioned(activity) && !canRunBeforeDeviceProvisioned()) {
|
||||
activity.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
String chooseLockAction = getActivity().getIntent().getAction();
|
||||
mFingerprintManager =
|
||||
@@ -224,6 +229,10 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
addHeaderView();
|
||||
}
|
||||
|
||||
protected boolean canRunBeforeDeviceProvisioned() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void addHeaderView() {
|
||||
if (mForFingerprint) {
|
||||
setHeaderView(R.layout.choose_lock_generic_fingerprint_header);
|
||||
|
@@ -626,7 +626,7 @@ public class SettingsActivity extends SettingsDrawerActivity
|
||||
// No UP affordance if we are displaying the main Dashboard
|
||||
mDisplayHomeAsUpEnabled = false;
|
||||
// Show Search affordance
|
||||
mDisplaySearch = true;
|
||||
mDisplaySearch = Utils.isDeviceProvisioned(this);
|
||||
mInitialTitleResId = R.string.dashboard_title;
|
||||
|
||||
// add argument to indicate which settings tab should be initially selected
|
||||
|
@@ -138,6 +138,11 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
|
||||
return layout.onCreateRecyclerView(inflater, parent, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canRunBeforeDeviceProvisioned() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/***
|
||||
* Disables preferences that are less secure than required quality and shows only secure
|
||||
* screen lock options here.
|
||||
|
Reference in New Issue
Block a user