summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-05-17 00:01:07 +0000
committerFabrice Di Meglio <fdimeglio@google.com>2014-05-17 00:01:07 +0000
commit93b77b7bf6d39f7549a4bd98c03aadad10b1a9ce (patch)
tree5a64c3e74ac50bd9ef54931baf7205eb703844e2 /src/com
parent18d271c73b17c9eb5570689247415a1d70583894 (diff)
downloadpackages_apps_Settings-93b77b7bf6d39f7549a4bd98c03aadad10b1a9ce.tar.gz
packages_apps_Settings-93b77b7bf6d39f7549a4bd98c03aadad10b1a9ce.tar.bz2
packages_apps_Settings-93b77b7bf6d39f7549a4bd98c03aadad10b1a9ce.zip
Revert "Fix bug #15001610 Java crash in settings is observed while adding Google account on wiped device"
This reverts commit 18d271c73b17c9eb5570689247415a1d70583894. Change-Id: I04f89dbb13ad1db92276c91a7ee63d3a5dd33e62
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/Utils.java12
-rw-r--r--src/com/android/settings/wifi/WifiPickerActivity.java23
2 files changed, 21 insertions, 14 deletions
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index ab5ee911e..36e19046b 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -518,7 +518,7 @@ public class Utils {
* entire activity.
*
* @param context The context.
- * @param fragmentClass The class name of the fragment to display.
+ * @param fragmentName The name of the fragment to display.
* @param args Optional arguments to supply to the fragment.
* @param resultTo Option fragment that should receive the result of
* the activity launch.
@@ -526,9 +526,9 @@ public class Utils {
* code in which to report the result.
* @param title String to display for the title of this set of preferences.
*/
- public static void startWithFragment(Context context, String fragmentClass, Bundle args,
+ public static void startWithFragment(Context context, String fragmentName, Bundle args,
Fragment resultTo, int resultRequestCode, CharSequence title) {
- Intent intent = onBuildStartFragmentIntent(context, fragmentClass, args, title);
+ Intent intent = onBuildStartFragmentIntent(context, fragmentName, args, title);
if (resultTo == null) {
context.startActivity(intent);
} else {
@@ -542,17 +542,17 @@ public class Utils {
* appropriate arguments to display the fragment.
*
* @param context The Context.
- * @param fragmentClass The class name of the fragment to display.
+ * @param fragmentName The name of the fragment to display.
* @param args Optional arguments to supply to the fragment.
* @param title Optional title to show for this item.
* @return Returns an Intent that can be launched to display the given
* fragment.
*/
- public static Intent onBuildStartFragmentIntent(Context context, String fragmentClass,
+ public static Intent onBuildStartFragmentIntent(Context context, String fragmentName,
Bundle args, CharSequence title) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClass(context, SubSettings.class);
- intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT, fragmentClass);
+ intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT, fragmentName);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS, args);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
return intent;
diff --git a/src/com/android/settings/wifi/WifiPickerActivity.java b/src/com/android/settings/wifi/WifiPickerActivity.java
index e7ae46216..deef8fa1a 100644
--- a/src/com/android/settings/wifi/WifiPickerActivity.java
+++ b/src/com/android/settings/wifi/WifiPickerActivity.java
@@ -16,7 +16,6 @@
package com.android.settings.wifi;
import com.android.settings.ButtonBarHandler;
-import com.android.settings.SettingsActivity;
import com.android.settings.wifi.p2p.WifiP2pSettings;
import android.app.Fragment;
@@ -25,7 +24,7 @@ import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.widget.Button;
-public class WifiPickerActivity extends SettingsActivity implements ButtonBarHandler {
+public class WifiPickerActivity extends PreferenceActivity implements ButtonBarHandler {
// Same as what are in PreferenceActivity as private.
private static final String EXTRA_PREFS_SHOW_BUTTON_BAR = "extra_prefs_show_button_bar";
@@ -40,6 +39,7 @@ public class WifiPickerActivity extends SettingsActivity implements ButtonBarHan
if (!modIntent.hasExtra(EXTRA_SHOW_FRAGMENT)) {
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, WifiSettings.class.getName());
}
+ modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}
@@ -52,14 +52,18 @@ public class WifiPickerActivity extends SettingsActivity implements ButtonBarHan
}
/**
- * Add additional codes for button bar handling.
+ * Almost dead copy of
+ * {@link PreferenceActivity#startWithFragment(String, Bundle, Fragment, int)}, except this has
+ * additional codes for button bar handling.
*/
- public void startPreferencePanel(String fragmentClass, Bundle args, int titleRes,
- CharSequence titleText, Fragment resultTo, int resultRequestCode) {
+ @Override
+ public void startWithFragment(String fragmentName, Bundle args,
+ Fragment resultTo, int resultRequestCode) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClass(this, getClass());
- intent.putExtra(EXTRA_SHOW_FRAGMENT, fragmentClass);
+ intent.putExtra(EXTRA_SHOW_FRAGMENT, fragmentName);
intent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, args);
+ intent.putExtra(EXTRA_NO_HEADERS, true);
final Intent orgIntent = getIntent();
if (orgIntent.hasExtra(EXTRA_PREFS_SHOW_BUTTON_BAR)) {
@@ -83,8 +87,11 @@ public class WifiPickerActivity extends SettingsActivity implements ButtonBarHan
orgIntent.getBooleanExtra(EXTRA_WIFI_SHOW_MENUS, true));
}
- super.startPreferencePanel(fragmentClass, args, titleRes, titleText, resultTo,
- resultRequestCode);
+ if (resultTo == null) {
+ startActivity(intent);
+ } else {
+ resultTo.startActivityForResult(intent, resultRequestCode);
+ }
}
@Override