From a4f4d185cf0a3c55cc4350f422e154dd4c637e16 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Fri, 5 Dec 2014 15:34:46 -0800 Subject: [PATCH 1/3] Add debug dataEnable. Change-Id: I4c2c49d9283652429affc190abacf7775ef3fe43 --- src/com/android/settings/DataUsageSummary.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java index 1c17ce5cbb4..e523fa77efb 100644 --- a/src/com/android/settings/DataUsageSummary.java +++ b/src/com/android/settings/DataUsageSummary.java @@ -959,22 +959,29 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable } /** - * Local cache of value, used to work around delay when - * {@link ConnectivityManager#setMobileDataEnabled(boolean)} is async. + * Local cache of value, used to work around delays. */ private Boolean mMobileDataEnabled; private boolean isMobileDataEnabled(int subId) { + if (LOGD) Log.d(TAG, "isMobileDataEnabled:+ subId=" + subId); boolean isEnable = false; if (mMobileDataEnabled != null) { // TODO: deprecate and remove this once enabled flag is on policy // Multiple Subscriptions, the value need to be reseted isEnable = mMobileDataEnabled.booleanValue(); + if (LOGD) { + Log.d(TAG, "isMobileDataEnabled: != null, subId=" + subId + + " isEnable=" + isEnable); + } mMobileDataEnabled = null; } else { - //SUB SELECT - isEnable = mTelephonyManager.getDataEnabled() - && (subId == mSubscriptionManager.getDefaultDataSubId()); + // SUB SELECT + isEnable = mTelephonyManager.getDataEnabled(subId); + if (LOGD) { + Log.d(TAG, "isMobileDataEnabled: == null, subId=" + subId + + " isEnable=" + isEnable); + } } return isEnable; } From aaaa54ec0eaf3b5d1a52161cd426caf13e2c364c Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Mon, 8 Dec 2014 15:20:33 -0500 Subject: [PATCH 2/3] Settings: Rebind to volume sliders after returning from stopped. Bug: 18118623 Change-Id: I29fb22a1a4476639a4f5cce06affd8ce58b6105d --- .../notification/VolumeSeekBarPreference.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/com/android/settings/notification/VolumeSeekBarPreference.java b/src/com/android/settings/notification/VolumeSeekBarPreference.java index 9a892b8f7af..409944f06fa 100644 --- a/src/com/android/settings/notification/VolumeSeekBarPreference.java +++ b/src/com/android/settings/notification/VolumeSeekBarPreference.java @@ -50,6 +50,7 @@ public class VolumeSeekBarPreference extends SeekBarPreference private boolean mMuted; private int mIconResId; private int mMuteIconResId; + private boolean mStopped; public VolumeSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { @@ -77,8 +78,15 @@ public class VolumeSeekBarPreference extends SeekBarPreference mCallback = callback; } + public void onActivityResume() { + if (mStopped) { + init(); + } + } + @Override public void onActivityStop() { + mStopped = true; if (mVolumizer != null) { mVolumizer.stop(); } @@ -91,10 +99,15 @@ public class VolumeSeekBarPreference extends SeekBarPreference Log.w(TAG, "No stream found, not binding volumizer"); return; } + mSeekBar = (SeekBar) view.findViewById(com.android.internal.R.id.seekbar); + mIconView = (ImageView) view.findViewById(com.android.internal.R.id.icon); + mSuppressionTextView = (TextView) view.findViewById(R.id.suppression_text); + init(); + } + + private void init() { + if (mSeekBar == null) return; getPreferenceManager().registerOnActivityStopListener(this); - final SeekBar seekBar = (SeekBar) view.findViewById(com.android.internal.R.id.seekbar); - if (seekBar == mSeekBar) return; - mSeekBar = seekBar; final SeekBarVolumizer.Callback sbvc = new SeekBarVolumizer.Callback() { @Override public void onSampleStarting(SeekBarVolumizer sbv) { @@ -121,19 +134,11 @@ public class VolumeSeekBarPreference extends SeekBarPreference } mVolumizer.start(); mVolumizer.setSeekBar(mSeekBar); - mIconView = (ImageView) view.findViewById(com.android.internal.R.id.icon); updateIconView(); - mSuppressionTextView = (TextView) view.findViewById(R.id.suppression_text); mCallback.onStreamValueChanged(mStream, mSeekBar.getProgress()); updateSuppressionText(); } - public void onActivityResume() { - if (mVolumizer != null) { - mVolumizer.start(); - } - } - // during initialization, this preference is the SeekBar listener @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) { From c29c58353679fc5df845bd9d565f7b421c5d9403 Mon Sep 17 00:00:00 2001 From: PauloftheWest Date: Mon, 8 Dec 2014 12:23:34 -0800 Subject: [PATCH 3/3] Fixed a SIM Cards crash. + Added a check if getActiveSubscriptionInfoList returns null. Bug: 18634751 Change-Id: Ib6012816c26525a61fb199912d06d6c1572e0fd6 --- src/com/android/settings/sim/SimDialogActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java index cf3ccdf5372..6aceb46c31d 100644 --- a/src/com/android/settings/sim/SimDialogActivity.java +++ b/src/com/android/settings/sim/SimDialogActivity.java @@ -152,7 +152,7 @@ public class SimDialogActivity extends Activity { final SubscriptionManager subscriptionManager = SubscriptionManager.from(context); final List subInfoList = subscriptionManager.getActiveSubscriptionInfoList(); - final int selectableSubInfoLength = subInfoList.size(); + final int selectableSubInfoLength = subInfoList == null ? 0 : subInfoList.size(); final DialogInterface.OnClickListener selectionListener = new DialogInterface.OnClickListener() {