Have isValidPhoneId and isValidSlotIndex based on activeModemCount.
Bug: 142514392 Test: sanity and unittest Change-Id: Ia66ee24151d1ec8ecde2dcb4c824a19b4d2cd172
This commit is contained in:
@@ -49,7 +49,6 @@ import android.os.Build;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.HandlerExecutor;
|
import android.os.HandlerExecutor;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
|
||||||
import android.os.ParcelUuid;
|
import android.os.ParcelUuid;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
@@ -2053,13 +2052,13 @@ public class SubscriptionManager {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||||
public static boolean isValidSlotIndex(int slotIndex) {
|
public static boolean isValidSlotIndex(int slotIndex) {
|
||||||
return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getSupportedModemCount();
|
return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getActiveModemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public static boolean isValidPhoneId(int phoneId) {
|
public static boolean isValidPhoneId(int phoneId) {
|
||||||
return phoneId >= 0 && phoneId < TelephonyManager.getDefault().getSupportedModemCount();
|
return phoneId >= 0 && phoneId < TelephonyManager.getDefault().getActiveModemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
|||||||
Reference in New Issue
Block a user