diff options
author | Lucky Zhang <luckyzh@google.com> | 2015-04-20 21:05:22 -0700 |
---|---|---|
committer | Lucky Zhang <luckyzh@google.com> | 2015-04-21 15:09:40 -0700 |
commit | a62d2c800caf3c1562ef93f207353bd86e8ddcd8 (patch) | |
tree | 2d1e6cb11bf3f283ccee26b422daf78c14b3db24 /src/com/android/settings/wifi/WifiSetupActivity.java | |
parent | e5112fe7665eca3dc47b5bb8bd2f22de77a44c44 (diff) | |
download | packages_apps_Settings-a62d2c800caf3c1562ef93f207353bd86e8ddcd8.zip packages_apps_Settings-a62d2c800caf3c1562ef93f207353bd86e8ddcd8.tar.gz packages_apps_Settings-a62d2c800caf3c1562ef93f207353bd86e8ddcd8.tar.bz2 |
[SetupWizard] Refactor WifiSetupActivity
Refactor WifiSetupActivity to respect the conventional logic of Setup
Wizard's SubactivityWrapper. WifiSetupActivity now returns the result
code back to WifiSettingsWrapper and lets the Wrapper invoke
WizardManager, instead of invoking WizardManager by itself and letting
its Wrapper finish early.
The related change in WifiSettingsWrapper on Setup Wizard side is
ag/676788.
Bug: 20309008
Change-Id: Ia3bc2ff390404ff87c427782b5e7b345050bea03
Diffstat (limited to 'src/com/android/settings/wifi/WifiSetupActivity.java')
-rw-r--r-- | src/com/android/settings/wifi/WifiSetupActivity.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/com/android/settings/wifi/WifiSetupActivity.java b/src/com/android/settings/wifi/WifiSetupActivity.java index 7d7fe3b..321ecb6 100644 --- a/src/com/android/settings/wifi/WifiSetupActivity.java +++ b/src/com/android/settings/wifi/WifiSetupActivity.java @@ -125,7 +125,7 @@ public class WifiSetupActivity extends WifiPickerActivity if (isWifiConnected()) { if (mAutoFinishOnConnection && mUserSelectedNetwork) { Log.d(TAG, "Auto-finishing with connection"); - finishOrNext(Activity.RESULT_OK); + finish(Activity.RESULT_OK); // Require a user selection before auto-finishing next time we are here. The user // can either connect to a different network or press "next" to proceed. mUserSelectedNetwork = false; @@ -195,18 +195,12 @@ public class WifiSetupActivity extends WifiPickerActivity } /** - * Complete this activity and return the results to the caller. If using WizardManager, this - * will invoke the next scripted action; otherwise, we simply finish. + * Complete this activity and return the results to the caller. */ - public void finishOrNext(int resultCode) { - Log.d(TAG, "finishOrNext resultCode=" + resultCode - + " isUsingWizardManager=" + SetupWizardUtils.isUsingWizardManager(this)); - if (SetupWizardUtils.isUsingWizardManager(this)) { - SetupWizardUtils.sendResultsToSetupWizard(this, resultCode); - } else { - setResult(resultCode); - finish(); - } + public void finish(int resultCode) { + Log.d(TAG, "finishing, resultCode=" + resultCode); + setResult(resultCode); + finish(); } @Override @@ -223,7 +217,7 @@ public class WifiSetupActivity extends WifiPickerActivity @Override public void onNavigateNext() { if (mWifiConnected) { - finishOrNext(RESULT_OK); + finish(RESULT_OK); } else { // Warn of possible data charges if there is a network connection, or lack of updates // if there is none. @@ -271,7 +265,7 @@ public class WifiSetupActivity extends WifiPickerActivity @Override public void onClick(DialogInterface dialog, int id) { WifiSetupActivity activity = (WifiSetupActivity) getActivity(); - activity.finishOrNext(RESULT_SKIP); + activity.finish(RESULT_SKIP); } }) .setNegativeButton(R.string.wifi_dont_skip, |