Refactor setup wizard-related code

Extracted setup-related code from WifiSettings, putting it into a new
derived class, WifiSettingsForSetupWizard.

Set taskAffinity to com.android.wizard, for alignment with other
setup wizard-related tasks.

Change-Id: If371f219dac5d3eff8f7899c16cc6f9475be47cf
This commit is contained in:
Russell Brenner
2014-05-23 13:03:15 -07:00
parent 7f4a7a114f
commit d3446c5708
7 changed files with 516 additions and 329 deletions

View File

@@ -21,22 +21,28 @@ import com.android.settings.wifi.p2p.WifiP2pSettings;
import android.content.Intent;
import java.lang.Class;
public class WifiPickerActivity extends SettingsActivity implements ButtonBarHandler {
@Override
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
if (!modIntent.hasExtra(EXTRA_SHOW_FRAGMENT)) {
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, WifiSettings.class.getName());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, getWifiSettingsClass().getName());
}
return modIntent;
}
@Override
protected boolean isValidFragment(String fragmentName) {
if (WifiSettings.class.getName().equals(fragmentName)
if (getWifiSettingsClass().getName().equals(fragmentName)
|| WifiP2pSettings.class.getName().equals(fragmentName)
|| AdvancedWifiSettings.class.getName().equals(fragmentName)) return true;
return false;
}
/* package */ Class getWifiSettingsClass() {
return WifiSettings.class;
}
}