Revert \"About Phone\" summary back to Android version.
am: fd4f729e1f
Change-Id: I77f3ed00516c02f8ca6ad888c166ed07a2f0f7f9
This commit is contained in:
@@ -32,8 +32,6 @@ import android.provider.Settings;
|
|||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
import android.support.v7.preference.PreferenceGroup;
|
import android.support.v7.preference.PreferenceGroup;
|
||||||
import android.telephony.CarrierConfigManager;
|
import android.telephony.CarrierConfigManager;
|
||||||
import android.telephony.SubscriptionInfo;
|
|
||||||
import android.telephony.SubscriptionManager;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@@ -379,39 +377,17 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
|
|||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final SummaryLoader mSummaryLoader;
|
private final SummaryLoader mSummaryLoader;
|
||||||
private final SubscriptionManager mSubscriptionManager;
|
|
||||||
private final SubscriptionChangeListener mSubscriptionChangeListener;
|
|
||||||
|
|
||||||
public SummaryProvider(Context context, SummaryLoader summaryLoader) {
|
public SummaryProvider(Context context, SummaryLoader summaryLoader) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mSummaryLoader = summaryLoader;
|
mSummaryLoader = summaryLoader;
|
||||||
mSubscriptionManager = SubscriptionManager.from(mContext);
|
|
||||||
mSubscriptionChangeListener = new SubscriptionChangeListener();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setListening(boolean listening) {
|
public void setListening(boolean listening) {
|
||||||
if (listening) {
|
if (listening) {
|
||||||
updateSummary();
|
mSummaryLoader.setSummary(this, mContext.getString(R.string.about_summary,
|
||||||
mSubscriptionManager.addOnSubscriptionsChangedListener(mSubscriptionChangeListener);
|
Build.VERSION.RELEASE));
|
||||||
} else {
|
|
||||||
mSubscriptionManager.removeOnSubscriptionsChangedListener(
|
|
||||||
mSubscriptionChangeListener);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateSummary() {
|
|
||||||
final String formattedPhoneNumbers = DeviceInfoUtils.getFormattedPhoneNumbers(
|
|
||||||
mContext, mSubscriptionManager.getActiveSubscriptionInfoList());
|
|
||||||
mSummaryLoader.setSummary(SummaryProvider.this, formattedPhoneNumbers);
|
|
||||||
}
|
|
||||||
|
|
||||||
private final class SubscriptionChangeListener
|
|
||||||
extends SubscriptionManager.OnSubscriptionsChangedListener {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSubscriptionsChanged() {
|
|
||||||
updateSummary();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user