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
- remove the search menu

Bug: 110034419
Test: make RunSettingsRoboTests
Change-Id: Ieb7eb0e8699229ec0824ccc19d7b958ac44965a2
Merged-In: Ieb7eb0e8699229ec0824ccc19d7b958ac44965a2
This commit is contained in:
Doris Ling
2018-07-31 14:04:44 -07:00
parent 0a8de9d763
commit 770f4abf9d
7 changed files with 149 additions and 3 deletions

View File

@@ -291,8 +291,10 @@ public class SettingsActivity extends SettingsDrawerActivity
launchSettingFragment(initialFragmentName, isSubSettings, intent);
}
final boolean deviceProvisioned = Utils.isDeviceProvisioned(this);
if (mIsShowingDashboard) {
findViewById(R.id.search_bar).setVisibility(View.VISIBLE);
findViewById(R.id.search_bar).setVisibility(
deviceProvisioned ? View.VISIBLE : View.INVISIBLE);
findViewById(R.id.action_bar).setVisibility(View.GONE);
final Toolbar toolbar = findViewById(R.id.search_action_bar);
FeatureFactory.getFactory(this).getSearchFeatureProvider()
@@ -311,7 +313,6 @@ public class SettingsActivity extends SettingsDrawerActivity
ActionBar actionBar = getActionBar();
if (actionBar != null) {
boolean deviceProvisioned = Utils.isDeviceProvisioned(this);
actionBar.setDisplayHomeAsUpEnabled(deviceProvisioned);
actionBar.setHomeButtonEnabled(deviceProvisioned);
actionBar.setDisplayShowTitleEnabled(!mIsShowingDashboard);