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

Commit e8df7c2a authored by Ethan Chen's avatar Ethan Chen
Browse files

Merge tag 'android-6.0.1_r3' into cm-13.0

Android 6.0.1 release 3

Change-Id: I351a4a53f0aa4d602ebbec8c997c1967e1f591eb
parents 749185c4 edb3e722
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2849,6 +2849,13 @@ public final class Telephony {
         */
        public static final String EDITED = "edited";

        /**
         * Is this APN visible to the user?
         * <p>Type: INTEGER (boolean) </p>
         * @hide
         */
        public static final String USER_VISIBLE = "user_visible";

        /**
         * <P>Type: INTEGER (boolean)</P>
         * @hide
+10 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ public abstract class Connection {
    private int mCallSubstate;
    private android.telecom.Connection.VideoProvider mVideoProvider;
    public Call.State mPreHandoverState = Call.State.IDLE;
    private Bundle mExtras;

    /* Instance Methods */

@@ -642,11 +643,20 @@ public abstract class Connection {
     * @param extras New connection extras.
     */
    public void setConnectionExtras(Bundle extras) {
        mExtras = extras;
        for (Listener l : mListeners) {
            l.onExtrasChanged(extras);
        }
    }

    /**
     * Retrieves the current connection extras.
     * @return the connection extras.
     */
    public Bundle getConnectionExtras() {
        return mExtras;
    }

    /**
     * Sets the call substate for the current connection and reports the changes to all listeners.
     * Valid call substates are defined in {@link android.telecom.Connection}.
+65 −3
Original line number Diff line number Diff line
@@ -198,6 +198,11 @@ public abstract class PhoneBase extends Handler implements Phone {
    // Key used to read/write the ID for storing the voice mail
    public static final String VM_ID = "vm_id_key";

    // Key used for storing call forwarding status
    public static final String CF_STATUS = "cf_status_key";
    // Key used to read/write the ID for storing the call forwarding status
    public static final String CF_ID = "cf_id_key";

    // Key used to read/write the SIM IMSI used for storing the imsi
    public static final String SIM_IMSI = "sim_imsi_key";
    // Key used to read/write SIM IMSI used for storing the imsi
@@ -1478,10 +1483,58 @@ public abstract class PhoneBase extends Handler implements Phone {
        return mVmCount != 0;
    }

    private int getCallForwardingIndicatorFromSharedPref() {
        int status = IccRecords.CALL_FORWARDING_STATUS_DISABLED;
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
        String subscriberId = sp.getString(CF_ID, null);
        String currentSubscriberId = getSubscriberId();

        if (currentSubscriberId != null && currentSubscriberId.equals(subscriberId)) {
            // get call forwarding status from preferences
            status = sp.getInt(CF_STATUS, IccRecords.CALL_FORWARDING_STATUS_DISABLED);
            Rlog.d(LOG_TAG, "Call forwarding status from preference = " + status);
        } else {
            Rlog.d(LOG_TAG, "Call forwarding status retrieval returning DISABLED as status for " +
                    "matching subscriberId not found");

        }
        return status;
    }

    private void setCallForwardingIndicatorInSharedPref(boolean enable) {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
        SharedPreferences.Editor editor = sp.edit();

        String imsi = getSubscriberId();

        editor.putInt(CF_STATUS, enable ? IccRecords.CALL_FORWARDING_STATUS_ENABLED :
                IccRecords.CALL_FORWARDING_STATUS_DISABLED);
        editor.putString(CF_ID, imsi);
        editor.apply();
    }

    public void setVoiceCallForwardingFlag(int line, boolean enable, String number) {
        setCallForwardingIndicatorInSharedPref(enable);
        mIccRecords.get().setVoiceCallForwardingFlag(line, enable, number);
    }

    protected void setVoiceCallForwardingFlag(IccRecords r, int line, boolean enable,
                                              String number) {
        setCallForwardingIndicatorInSharedPref(enable);
        r.setVoiceCallForwardingFlag(line, enable, number);
    }

    @Override
    public boolean getCallForwardingIndicator() {
        IccRecords r = mIccRecords.get();
        return (r != null) ? r.getVoiceCallForwardingFlag() : false;
        int callForwardingIndicator = IccRecords.CALL_FORWARDING_STATUS_UNKNOWN;
        if (r != null) {
            callForwardingIndicator = r.getVoiceCallForwardingFlag();
        }
        if (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_UNKNOWN) {
            callForwardingIndicator = getCallForwardingIndicatorFromSharedPref();
        }
        return (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_ENABLED);
    }

    /**
@@ -1842,8 +1895,7 @@ public abstract class PhoneBase extends Handler implements Phone {
        String subscriberId = sp.getString(VM_ID, null);
        String currentSubscriberId = getSubscriberId();

        if ((subscriberId != null) && (currentSubscriberId != null)
                && (currentSubscriberId.equals(subscriberId))) {
        if (currentSubscriberId != null && currentSubscriberId.equals(subscriberId)) {
            // get voice mail count from preferences
            countVoiceMessages = sp.getInt(VM_COUNT, 0);
            Rlog.d(LOG_TAG, "Voice Mail Count from preference = " + countVoiceMessages);
@@ -2679,6 +2731,16 @@ public abstract class PhoneBase extends Handler implements Phone {
        return getLocaleFromCarrierProperties(mContext);
    }

    protected boolean isMatchGid(String gid) {
        String gid1 = getGroupIdLevel1();
        int gidLength = gid.length();
        if (!TextUtils.isEmpty(gid1) && (gid1.length() >= gidLength)
                && gid1.substring(0, gidLength).equalsIgnoreCase(gid)) {
            return true;
        }
        return false;
    }

    /* Validate the given extras if the call is for CS domain or not */
    protected boolean shallDialOnCircuitSwitch(Bundle extras) {
            return (extras != null && extras.getInt(QtiVideoCallConstants.EXTRA_CALL_DOMAIN,
+1 −0
Original line number Diff line number Diff line
@@ -711,6 +711,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                    Context.DISPLAY_SERVICE);
            mDefaultDisplay = dm.getDisplay(Display.DEFAULT_DISPLAY);
            dm.registerDisplayListener(mDisplayListener, null);
            mDefaultDisplayState = mDefaultDisplay.getState();

            IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
            Intent batteryStatus = context.registerReceiver(mBatteryStateListener, filter);
+2 −1
Original line number Diff line number Diff line
@@ -292,7 +292,8 @@ public class SubscriptionController extends ISub.Stub {
                SubscriptionManager.USER_NETWORK_MODE));

        if (DBG) {
            logd("[getSubInfoRecord] id:" + id + " iccid:" + iccId + " simSlotIndex:" + simSlotIndex
            String iccIdToPrint = SubscriptionInfo.givePrintableIccid(iccId);
            logd("[getSubInfoRecord] id:" + id + " iccid:" + iccIdToPrint + " simSlotIndex:" + simSlotIndex
                + " displayName:" + displayName + " nameSource:" + nameSource
                + " iconTint:" + iconTint + " dataRoaming:" + dataRoaming
                + " mcc:" + mcc + " mnc:" + mnc + " countIso:" + countryIso + " userNwMode:" + userNwMode);
Loading