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

Commit 0ccab45a authored by Pengquan Meng's avatar Pengquan Meng Committed by android-build-merger
Browse files

Merge "Add getSlotsMapping to TelephonyManager"

am: 60082727

Change-Id: I7eace0e5cc7cd3f58cdddde3837a7c8b714e08ba
parents 006f7543 60082727
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6352,6 +6352,7 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.util.Pair<java.lang.Integer,java.lang.Integer>> getLogicalToPhysicalSlotMapping();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmap();
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
    method public int getSimApplicationState();
+30 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;

import com.android.ims.internal.IImsServiceFeatureCallback;
import com.android.internal.annotations.VisibleForTesting;
@@ -3252,6 +3253,35 @@ public class TelephonyManager {
        }
    }

    /**
     * Get the mapping from logical slots to physical slots. The mapping represent by a pair list.
     * The key of the piar is the logical slot id and the value of the pair is the physical
     * slots id mapped to this logical slot id.
     *
     * @return an pair list indicates the mapping from logical slots to physical slots. The size of
     * the list should be {@link #getPhoneCount()} if success, otherwise return an empty list.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @NonNull
    public List<Pair<Integer, Integer>> getLogicalToPhysicalSlotMapping() {
        List<Pair<Integer, Integer>> slotMapping = new ArrayList<>();
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                int[] slotMappingArray = telephony.getSlotsMapping();
                for (int i = 0; i < slotMappingArray.length; i++) {
                    slotMapping.add(new Pair(i, slotMappingArray[i]));
                }
            }
        } catch (RemoteException e) {
            Log.e(TAG, "getSlotsMapping RemoteException", e);
        }
        return slotMapping;
    }

    //
    //
    // Subscriber Info
+6 −0
Original line number Diff line number Diff line
@@ -1840,9 +1840,15 @@ interface ITelephony {
     * @hide
     */
    int getNumOfActiveSims();

    /**
     * Get if reboot is required upon altering modems configurations
     * @hide
     */
    boolean isRebootRequiredForModemConfigChange();

    /**
     * Get the mapping from logical slots to physical slots.
     */
    int[] getSlotsMapping();
}