From e226b384096018a413c363888917cf779661c054 Mon Sep 17 00:00:00 2001 From: Tony Mak Date: Fri, 2 Mar 2018 18:23:35 +0000 Subject: [PATCH] Only enable up button if device is provisioned Test: Carry out QR provisioning, observe that no more back button in the nav bar of wifi picker page Test: After SuW flow, Run adb shell am start -a android.net.wifi.PICK_WIFI_NETWORK Observe there is a back button in the nav bar. Change-Id: I50ec5b2c465eee87f5a7906e3353a0070c65e2ee FIX: 74059636 --- src/com/android/settings/SettingsActivity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index 0f50d7164f7..8b71df19f50 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -308,8 +308,9 @@ public class SettingsActivity extends SettingsDrawerActivity ActionBar actionBar = getActionBar(); if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setHomeButtonEnabled(true); + boolean deviceProvisioned = Utils.isDeviceProvisioned(this); + actionBar.setDisplayHomeAsUpEnabled(deviceProvisioned); + actionBar.setHomeButtonEnabled(deviceProvisioned); actionBar.setDisplayShowTitleEnabled(!mIsShowingDashboard); } mSwitchBar = findViewById(R.id.switch_bar);