Don't crash during setup of secondary users

Make sure to call super.onActivityCreated() even in the short-circuit
case where there's an early 'return'.  This has probably been broken
for a long time but was never exercised while bringing up a new-from-
scratch device, but is the usual code path now for secondary users.

Change-Id: I0c1a5116440908d65750133689507917307e1dcd
This commit is contained in:
Christopher Tate
2012-09-12 14:27:43 -07:00
parent fc76a78c45
commit df5a62e30b

View File

@@ -239,7 +239,6 @@ public class WifiSettings extends SettingsPreferenceFragment
// We don't call super.onActivityCreated() here, since it assumes we already set up
// Preference (probably in onCreate()), while WifiSettings exceptionally set it up in
// this method.
mP2pSupported = getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_DIRECT);
mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
@@ -295,6 +294,7 @@ public class WifiSettings extends SettingsPreferenceFragment
getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivity != null
&& connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected()) {
super.onActivityCreated(savedInstanceState);
activity.finish();
return;
}