From 39f40c7687c9eeba56e60250366b4bd383e53a26 Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Thu, 30 Jan 2014 13:14:02 -0800 Subject: [PATCH 1/4] packages/apps/Settings: Rename persist.sys.dalvik.vm.lib to allow new default Bug: 12798969 Change-Id: I1937c2ff758214e1c9d369e475ae4efbba4f9dec --- src/com/android/settings/DevelopmentSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index f16a19bf861..f8b4fd3c168 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -95,7 +95,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment private static final String KEEP_SCREEN_ON = "keep_screen_on"; private static final String BT_HCI_SNOOP_LOG = "bt_hci_snoop_log"; private static final String SELECT_RUNTIME_KEY = "select_runtime"; - private static final String SELECT_RUNTIME_PROPERTY = "persist.sys.dalvik.vm.lib"; + private static final String SELECT_RUNTIME_PROPERTY = "persist.sys.dalvik.vm.lib.1"; private static final String ALLOW_MOCK_LOCATION = "allow_mock_location"; private static final String HDCP_CHECKING_KEY = "hdcp_checking"; private static final String HDCP_CHECKING_PROPERTY = "persist.sys.hdcp_checking"; From 6a2d0ca9f4a30b62f7551e70695dd648305c0778 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Tue, 4 Feb 2014 12:41:30 -0800 Subject: [PATCH 2/4] Fix bug #12890490 Crash in Settings observed after tap on Preferred Engine settings and Cloud print option - when setting the Fragment's title use the CharSequence when the titleRes ID is "0" Change-Id: I54e5379172632acfc967b5ea401ba90f73b41748 --- .../android/settings/SettingsActivity.java | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index c3d067f7301..a362ee622f6 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -924,7 +924,7 @@ public class SettingsActivity extends Activity public void startPreferencePanel(String fragmentClass, Bundle args, int titleRes, CharSequence titleText, Fragment resultTo, int resultRequestCode) { - startWithFragment(fragmentClass, args, resultTo, resultRequestCode, titleRes, 0); + startWithFragment(fragmentClass, args, resultTo, resultRequestCode, titleRes, titleText); } /** @@ -965,16 +965,16 @@ public class SettingsActivity extends Activity * @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. - * @param resultRequestCode If resultTo is non-null, this is the request - * code in which to report the result. - * @param titleRes Resource ID of string to display for the title of - * this set of preferences. - * @param shortTitleRes Resource ID of string to display for the short title of - * this set of preferences. + * the activity launch. + * @param resultRequestCode If resultTo is non-null, this is the request code in which to + * report the result. + * @param titleRes Resource ID of string to display for the title of. If the Resource ID is a + * valid one then it will be used to get the title. Otherwise the titleText + * argument will be used as the title. + * @param titleText string to display for the title of. */ private void startWithFragment(String fragmentName, Bundle args, Fragment resultTo, - int resultRequestCode, int titleRes, int shortTitleRes) { + int resultRequestCode, int titleRes, CharSequence titleText) { Fragment f = Fragment.instantiate(this, fragmentName, args); if (resultTo != null) { f.setTargetFragment(resultTo, resultRequestCode); @@ -985,10 +985,17 @@ public class SettingsActivity extends Activity transaction.addToBackStack(BACK_STACK_PREFS); transaction.commitAllowingStateLoss(); - final CharSequence title = getText(titleRes); - final TitlePair pair = new TitlePair(titleRes, null); + final TitlePair pair; + final CharSequence cs; + if (titleRes != 0) { + pair = new TitlePair(titleRes, null); + cs = getText(titleRes); + } else { + pair = new TitlePair(0, titleText); + cs = titleText; + } + setTitle(cs); mTitleStack.add(pair); - setTitle(title); } /** @@ -1583,7 +1590,7 @@ public class SettingsActivity extends Activity /** * Called when the user selects an item in the header list. The default * implementation will call either - * {@link #startWithFragment(String, Bundle, Fragment, int, int, int)} + * {@link #startWithFragment(String, android.os.Bundle, android.app.Fragment, int, int, CharSequence)} * or {@link #switchToHeader(com.android.settings.SettingsActivity.Header, boolean)} * as appropriate. * From 3513cda38c613a22192a6f6a5800b18fe4df13c3 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Tue, 4 Feb 2014 14:01:39 -0800 Subject: [PATCH 3/4] Fix bug #12890909 Tablets: Settings crashes when tapped on Add Account option in settings - remove android:theme="@android:style/Theme.Holo.DialogWhenLarge" for com.android.settings.Settings$ChooseAccountActivity Change-Id: Ife94e93e057029a71fe4a276f7ef9b98c9561b87 --- AndroidManifest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ec01534e3d8..6ba9a94fb46 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1538,8 +1538,7 @@ + android:configChanges="orientation|keyboardHidden|screenSize"> From b608b8a4344fcf5b6de40b87c61a9ca0e6e2bf0f Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Tue, 4 Feb 2014 14:20:28 -0800 Subject: [PATCH 4/4] Fix bug #12895706 BT settings crash with java.lang.ClassCastException: com.android.settings.Settings cannot be cast to android.preference.PreferenceActivity - remove the PreferenceActivity related code as we are no more using PreferenceActivity (and Settings is a derive of SettingsActivity) Change-Id: I3c650c03cd205d9c06679974ae4d832ced25459b --- .../settings/bluetooth/LocalDeviceProfilesSettings.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java b/src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java index f01bbf5eca9..8d7100745fc 100644 --- a/src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java +++ b/src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java @@ -19,7 +19,6 @@ package com.android.settings.bluetooth; import android.os.Bundle; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; -import android.preference.PreferenceActivity; import android.preference.PreferenceScreen; import com.android.settings.R; @@ -73,8 +72,6 @@ public final class LocalDeviceProfilesSettings extends SettingsPreferenceFragmen // preference can be updated when the timeout changes. mDiscoverableEnabler.setVisibilityPreference(mVisibilityPref); - PreferenceActivity mActivity = (PreferenceActivity)getActivity(); - mActivity.showBreadCrumbs(mManager.getBluetoothAdapter().getName(), ""); PreferenceScreen bluetoothBroadcast = (PreferenceScreen)findPreference(KEY_BROADCASTING); mAdvertisingEnabler = new BluetoothAdvertisingEnabler(getActivity(), bluetoothBroadcast); mManager.setBluetoothAdvertisingEnabler(mAdvertisingEnabler);