Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a69a7c5 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 8d3eeac9 on remote branch

Change-Id: Ie7a9f2e60fc2c7da5d5ee020234a1cfff82c908a
parents 3ecd2c38 8d3eeac9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1088,7 +1088,8 @@
    <string-array name="show_account_list">
        <item>com.android.exchange</item>
        <item>com.google</item>
        <item>com.android.email</item>
        <item>com.android.email.legacy.imap</item>
        <item>com.android.email.pop3</item>
    </string-array>

    <string-array name="plmn_list_for_apn_disable">
+34 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.support.v7.preference.Preference;
import android.text.TextUtils;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -52,6 +54,7 @@ import android.widget.TextView;
import com.google.android.collect.Lists;

import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.internal.telephony.OperatorSimInfo;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settingslib.RestrictedLockUtils;
@@ -82,6 +85,9 @@ public class AccountSyncSettings extends AccountPreferenceBase {
                new ArrayList<SyncStateSwitchPreference>();
    private ArrayList<SyncAdapterType> mInvisibleAdapters = Lists.newArrayList();

    private final String SIM1_ACCOUNT_NAME = "SIM1";
    private final String SIM2_ACCOUNT_NAME = "SIM2";

    @Override
    public Dialog onCreateDialog(final int id) {
        Dialog dialog = null;
@@ -562,6 +568,20 @@ public class AccountSyncSettings extends AccountPreferenceBase {
        if (mAccount != null) {
            mProviderIcon.setImageDrawable(getDrawableForType(mAccount.type));
            mProviderId.setText(getLabelForType(mAccount.type));
            //Sim Icon Customisation feature change
            OperatorSimInfo operatorSimInfo = new OperatorSimInfo(getActivity().
                    getApplicationContext());
            boolean isCustomSimFeatureEnabled = operatorSimInfo.
                    isOperatorFeatureEnabled();
            if (isCustomSimFeatureEnabled) {
                String accountName = mAccount.name;
                if (accountName.equalsIgnoreCase(SIM1_ACCOUNT_NAME)) {
                    showOperatorSimIcon(0, operatorSimInfo);
                } else if (accountName.equalsIgnoreCase(SIM2_ACCOUNT_NAME)) {
                    showOperatorSimIcon(1, operatorSimInfo);
                }
            }

        }
    }

@@ -569,4 +589,18 @@ public class AccountSyncSettings extends AccountPreferenceBase {
    protected int getHelpResource() {
        return R.string.help_url_accounts;
    }

    private void showOperatorSimIcon(int slotIndex, OperatorSimInfo operatorSimInfo) {
       boolean isSimTypeOperator = operatorSimInfo.isSimTypeOperator(slotIndex);
       if (isSimTypeOperator) {
           mProviderIcon.setImageDrawable(operatorSimInfo.getOperatorDrawable());
           mUserId.setText(operatorSimInfo.getOperatorDisplayName());
       } else {
           mProviderIcon.setImageDrawable(operatorSimInfo.getGenericSimDrawable());
           int subId = SubscriptionManager.getSubId(slotIndex)[0];
           String operatorName = TelephonyManager.from(getActivity().
                   getApplicationContext()).getSimOperator(subId);
           mUserId.setText(operatorName);
       }
   }
}
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,6 @@ public abstract class DeviceListPreferenceFragment extends
        if (preference == null) {
            preference = new BluetoothDevicePreference(getPrefContext(), cachedDevice);
            preference.setKey(key);
            mDeviceListGroup.addPreference(preference);
        } else {
            // Tell the preference it is being re-used in case there is new info in the
            // cached device.
@@ -190,6 +189,7 @@ public abstract class DeviceListPreferenceFragment extends
        }

        initDevicePreference(preference);
        mDeviceListGroup.addPreference(preference);
        mDevicePreferenceMap.put(cachedDevice, preference);
    }