DO NOT MERGE Disable changing lock when device is not provisioned.
When the device is not yet provisioned and settings is launched: - disable the entry point for changing device lock - remove the search panel from settings home page Bug: 110034419 Test: make RunSettingsRoboTests Change-Id: Ieb7eb0e8699229ec0824ccc19d7b958ac44965a2
This commit is contained in:
@@ -133,6 +133,11 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
final Activity activity = getActivity();
|
||||||
|
if (!Utils.isDeviceProvisioned(activity) && !canRunBeforeDeviceProvisioned()) {
|
||||||
|
activity.finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mFingerprintManager =
|
mFingerprintManager =
|
||||||
(FingerprintManager) getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
|
(FingerprintManager) getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
|
||||||
@@ -216,6 +221,10 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
addHeaderView();
|
addHeaderView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean canRunBeforeDeviceProvisioned() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected void addHeaderView() {
|
protected void addHeaderView() {
|
||||||
if (mForFingerprint) {
|
if (mForFingerprint) {
|
||||||
setHeaderView(R.layout.choose_lock_generic_fingerprint_header);
|
setHeaderView(R.layout.choose_lock_generic_fingerprint_header);
|
||||||
|
@@ -619,7 +619,7 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
// No UP affordance if we are displaying the main Dashboard
|
// No UP affordance if we are displaying the main Dashboard
|
||||||
mDisplayHomeAsUpEnabled = false;
|
mDisplayHomeAsUpEnabled = false;
|
||||||
// Show Search affordance
|
// Show Search affordance
|
||||||
mDisplaySearch = true;
|
mDisplaySearch = Utils.isDeviceProvisioned(this);
|
||||||
mInitialTitleResId = R.string.dashboard_title;
|
mInitialTitleResId = R.string.dashboard_title;
|
||||||
switchToFragment(DashboardSummary.class.getName(), null, false, false,
|
switchToFragment(DashboardSummary.class.getName(), null, false, false,
|
||||||
mInitialTitleResId, mInitialTitle, false);
|
mInitialTitleResId, mInitialTitle, false);
|
||||||
|
@@ -147,6 +147,11 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
|
|||||||
return layout.onCreateRecyclerView(inflater, parent, savedInstanceState);
|
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
|
* Disables preferences that are less secure than required quality and shows only secure
|
||||||
* screen lock options here.
|
* screen lock options here.
|
||||||
|
Reference in New Issue
Block a user