Merge branch 'master' of https://googleplex-android.googlesource.com/_direct/platform/packages/apps/Settings
This commit is contained in:
@@ -966,22 +966,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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -152,7 +152,7 @@ public class SimDialogActivity extends Activity {
|
||||
final SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
|
||||
final List<SubscriptionInfo> subInfoList =
|
||||
subscriptionManager.getActiveSubscriptionInfoList();
|
||||
final int selectableSubInfoLength = subInfoList.size();
|
||||
final int selectableSubInfoLength = subInfoList == null ? 0 : subInfoList.size();
|
||||
|
||||
final DialogInterface.OnClickListener selectionListener =
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
Reference in New Issue
Block a user