Merge changes from topics "141018421_set3", "146905502", "remove_getPhoneId"
* changes: Make sanitizeLocationInfo System Api. Expose setUiccApplicationsEnabled as @SystemApi for eSIM to call upon slot mapping change. Mainline: remove usage of hiddepn API SubscriptionManager#getPhoneId
This commit is contained in:
@@ -8761,6 +8761,7 @@ package android.telephony {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class ServiceState implements android.os.Parcelable {
|
public class ServiceState implements android.os.Parcelable {
|
||||||
|
method @NonNull public android.telephony.ServiceState createLocationInfoSanitizedCopy(boolean);
|
||||||
method public int getDataRegistrationState();
|
method public int getDataRegistrationState();
|
||||||
method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
|
method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
|
||||||
method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList();
|
method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList();
|
||||||
@@ -8927,6 +8928,7 @@ package android.telephony {
|
|||||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultVoiceSubscriptionId(int);
|
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultVoiceSubscriptionId(int);
|
||||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
|
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
|
||||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean);
|
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean);
|
||||||
|
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUiccApplicationsEnabled(boolean, int);
|
||||||
field @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS) public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED";
|
field @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS) public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED";
|
||||||
field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
|
field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
|
||||||
field public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff
|
field public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.server;
|
package com.android.server;
|
||||||
|
|
||||||
|
import static android.telephony.SubscriptionManager.INVALID_SIM_SLOT_INDEX;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.AppOpsManager;
|
import android.app.AppOpsManager;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
@@ -37,6 +39,7 @@ import android.os.SystemClock;
|
|||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.service.carrier.CarrierMessagingService;
|
import android.service.carrier.CarrierMessagingService;
|
||||||
import android.telephony.SmsManager;
|
import android.telephony.SmsManager;
|
||||||
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -512,11 +515,11 @@ public class MmsServiceBroker extends SystemService {
|
|||||||
|
|
||||||
// Grant permission for the carrier app.
|
// Grant permission for the carrier app.
|
||||||
Intent intent = new Intent(action);
|
Intent intent = new Intent(action);
|
||||||
TelephonyManager telephonyManager =
|
TelephonyManager telephonyManager = (TelephonyManager)
|
||||||
(TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
|
mContext.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
List<String> carrierPackages =
|
List<String> carrierPackages = telephonyManager
|
||||||
telephonyManager.getCarrierPackageNamesForIntentAndPhone(
|
.getCarrierPackageNamesForIntentAndPhone(
|
||||||
intent, SubscriptionManager.getPhoneId(subId));
|
intent, getPhoneIdFromSubId(subId));
|
||||||
if (carrierPackages != null && carrierPackages.size() == 1) {
|
if (carrierPackages != null && carrierPackages.size() == 1) {
|
||||||
LocalServices.getService(UriGrantsManagerInternal.class)
|
LocalServices.getService(UriGrantsManagerInternal.class)
|
||||||
.grantUriPermissionFromIntent(callingUid, carrierPackages.get(0),
|
.grantUriPermissionFromIntent(callingUid, carrierPackages.get(0),
|
||||||
@@ -528,4 +531,13 @@ public class MmsServiceBroker extends SystemService {
|
|||||||
return contentUri;
|
return contentUri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getPhoneIdFromSubId(int subId) {
|
||||||
|
SubscriptionManager subManager = (SubscriptionManager)
|
||||||
|
mContext.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
||||||
|
if (subManager == null) return INVALID_SIM_SLOT_INDEX;
|
||||||
|
SubscriptionInfo info = subManager.getActiveSubscriptionInfo(subId);
|
||||||
|
if (info == null) return INVALID_SIM_SLOT_INDEX;
|
||||||
|
return info.getSimSlotIndex();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.server;
|
package com.android.server;
|
||||||
|
|
||||||
|
import static android.telephony.SubscriptionManager.INVALID_SIM_SLOT_INDEX;
|
||||||
import static android.telephony.TelephonyManager.ACTION_MULTI_SIM_CONFIG_CHANGED;
|
import static android.telephony.TelephonyManager.ACTION_MULTI_SIM_CONFIG_CHANGED;
|
||||||
import static android.telephony.TelephonyRegistryManager.SIM_ACTIVATION_TYPE_DATA;
|
import static android.telephony.TelephonyRegistryManager.SIM_ACTIVATION_TYPE_DATA;
|
||||||
import static android.telephony.TelephonyRegistryManager.SIM_ACTIVATION_TYPE_VOICE;
|
import static android.telephony.TelephonyRegistryManager.SIM_ACTIVATION_TYPE_VOICE;
|
||||||
@@ -57,6 +58,7 @@ import android.telephony.PreciseDisconnectCause;
|
|||||||
import android.telephony.Rlog;
|
import android.telephony.Rlog;
|
||||||
import android.telephony.ServiceState;
|
import android.telephony.ServiceState;
|
||||||
import android.telephony.SignalStrength;
|
import android.telephony.SignalStrength;
|
||||||
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.telephony.data.ApnSetting;
|
import android.telephony.data.ApnSetting;
|
||||||
@@ -95,7 +97,7 @@ import java.util.NoSuchElementException;
|
|||||||
* and 15973975 by saving the phoneId of the registrant and then using the
|
* and 15973975 by saving the phoneId of the registrant and then using the
|
||||||
* phoneId when deciding to to make a callback. This is necessary because
|
* phoneId when deciding to to make a callback. This is necessary because
|
||||||
* a subId changes from to a dummy value when a SIM is removed and thus won't
|
* a subId changes from to a dummy value when a SIM is removed and thus won't
|
||||||
* compare properly. Because SubscriptionManager.getPhoneId(int subId) handles
|
* compare properly. Because getPhoneIdFromSubId(int subId) handles
|
||||||
* the dummy value conversion we properly do the callbacks.
|
* the dummy value conversion we properly do the callbacks.
|
||||||
*
|
*
|
||||||
* Eventually we may want to remove the notion of dummy value but for now this
|
* Eventually we may want to remove the notion of dummy value but for now this
|
||||||
@@ -128,7 +130,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
|
|
||||||
int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
|
|
||||||
int phoneId = SubscriptionManager.INVALID_PHONE_INDEX;
|
int phoneId = SubscriptionManager.INVALID_SIM_SLOT_INDEX;
|
||||||
|
|
||||||
boolean matchPhoneStateListenerEvent(int events) {
|
boolean matchPhoneStateListenerEvent(int events) {
|
||||||
return (callback != null) && ((events & this.events) != 0);
|
return (callback != null) && ((events & this.events) != 0);
|
||||||
@@ -226,7 +228,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
|
|
||||||
private int mDefaultSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
private int mDefaultSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
|
|
||||||
private int mDefaultPhoneId = SubscriptionManager.INVALID_PHONE_INDEX;
|
private int mDefaultPhoneId = SubscriptionManager.INVALID_SIM_SLOT_INDEX;
|
||||||
|
|
||||||
private int[] mRingingCallState;
|
private int[] mRingingCallState;
|
||||||
|
|
||||||
@@ -355,7 +357,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
SubscriptionManager.getDefaultSubscriptionId());
|
SubscriptionManager.getDefaultSubscriptionId());
|
||||||
int newDefaultPhoneId = intent.getIntExtra(
|
int newDefaultPhoneId = intent.getIntExtra(
|
||||||
SubscriptionManager.EXTRA_SLOT_INDEX,
|
SubscriptionManager.EXTRA_SLOT_INDEX,
|
||||||
SubscriptionManager.getPhoneId(newDefaultSubId));
|
getPhoneIdFromSubId(newDefaultSubId));
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
log("onReceive:current mDefaultSubId=" + mDefaultSubId
|
log("onReceive:current mDefaultSubId=" + mDefaultSubId
|
||||||
+ " current mDefaultPhoneId=" + mDefaultPhoneId
|
+ " current mDefaultPhoneId=" + mDefaultPhoneId
|
||||||
@@ -751,7 +753,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
// register
|
// register
|
||||||
IBinder b = callback.asBinder();
|
IBinder b = callback.asBinder();
|
||||||
@@ -786,9 +788,11 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
if (checkFineLocationAccess(r, Build.VERSION_CODES.Q)) {
|
if (checkFineLocationAccess(r, Build.VERSION_CODES.Q)) {
|
||||||
r.callback.onServiceStateChanged(rawSs);
|
r.callback.onServiceStateChanged(rawSs);
|
||||||
} else if (checkCoarseLocationAccess(r, Build.VERSION_CODES.Q)) {
|
} else if (checkCoarseLocationAccess(r, Build.VERSION_CODES.Q)) {
|
||||||
r.callback.onServiceStateChanged(rawSs.sanitizeLocationInfo(false));
|
r.callback.onServiceStateChanged(
|
||||||
|
rawSs.createLocationInfoSanitizedCopy(false));
|
||||||
} else {
|
} else {
|
||||||
r.callback.onServiceStateChanged(rawSs.sanitizeLocationInfo(true));
|
r.callback.onServiceStateChanged(
|
||||||
|
rawSs.createLocationInfoSanitizedCopy(true));
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
remove(r.binder);
|
remove(r.binder);
|
||||||
@@ -1077,7 +1081,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
// Called only by Telecomm to communicate call state across different phone accounts. So
|
// Called only by Telecomm to communicate call state across different phone accounts. So
|
||||||
// there is no need to add a valid subId or slotId.
|
// there is no need to add a valid subId or slotId.
|
||||||
broadcastCallStateChanged(state, phoneNumber,
|
broadcastCallStateChanged(state, phoneNumber,
|
||||||
SubscriptionManager.INVALID_PHONE_INDEX,
|
SubscriptionManager.INVALID_SIM_SLOT_INDEX,
|
||||||
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1144,9 +1148,9 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
if (checkFineLocationAccess(r, Build.VERSION_CODES.Q)) {
|
if (checkFineLocationAccess(r, Build.VERSION_CODES.Q)) {
|
||||||
stateToSend = new ServiceState(state);
|
stateToSend = new ServiceState(state);
|
||||||
} else if (checkCoarseLocationAccess(r, Build.VERSION_CODES.Q)) {
|
} else if (checkCoarseLocationAccess(r, Build.VERSION_CODES.Q)) {
|
||||||
stateToSend = state.sanitizeLocationInfo(false);
|
stateToSend = state.createLocationInfoSanitizedCopy(false);
|
||||||
} else {
|
} else {
|
||||||
stateToSend = state.sanitizeLocationInfo(true);
|
stateToSend = state.createLocationInfoSanitizedCopy(true);
|
||||||
}
|
}
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
log("notifyServiceStateForSubscriber: callback.onSSC r=" + r
|
log("notifyServiceStateForSubscriber: callback.onSSC r=" + r
|
||||||
@@ -1301,7 +1305,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
mCarrierNetworkChangeState = active;
|
mCarrierNetworkChangeState = active;
|
||||||
for (int subId : subIds) {
|
for (int subId : subIds) {
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
|
|
||||||
if (VDBG) {
|
if (VDBG) {
|
||||||
log("notifyCarrierNetworkChange: active=" + active + "subId: " + subId);
|
log("notifyCarrierNetworkChange: active=" + active + "subId: " + subId);
|
||||||
@@ -1334,7 +1338,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
log("notifyCellInfoForSubscriber: subId=" + subId
|
log("notifyCellInfoForSubscriber: subId=" + subId
|
||||||
+ " cellInfo=" + cellInfo);
|
+ " cellInfo=" + cellInfo);
|
||||||
}
|
}
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
if (validatePhoneId(phoneId)) {
|
if (validatePhoneId(phoneId)) {
|
||||||
mCellInfo.set(phoneId, cellInfo);
|
mCellInfo.set(phoneId, cellInfo);
|
||||||
@@ -1425,7 +1429,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
log("notifyCallForwardingChangedForSubscriber: subId=" + subId
|
log("notifyCallForwardingChangedForSubscriber: subId=" + subId
|
||||||
+ " cfi=" + cfi);
|
+ " cfi=" + cfi);
|
||||||
}
|
}
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
if (validatePhoneId(phoneId)) {
|
if (validatePhoneId(phoneId)) {
|
||||||
mCallForwarding[phoneId] = cfi;
|
mCallForwarding[phoneId] = cfi;
|
||||||
@@ -1453,7 +1457,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
if (!checkNotifyPermission("notifyDataActivity()" )) {
|
if (!checkNotifyPermission("notifyDataActivity()" )) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
if (validatePhoneId(phoneId)) {
|
if (validatePhoneId(phoneId)) {
|
||||||
mDataActivity[phoneId] = state;
|
mDataActivity[phoneId] = state;
|
||||||
@@ -1626,7 +1630,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
log("notifyCellLocationForSubscriber: subId=" + subId
|
log("notifyCellLocationForSubscriber: subId=" + subId
|
||||||
+ " cellLocation=" + cellLocation);
|
+ " cellLocation=" + cellLocation);
|
||||||
}
|
}
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
if (validatePhoneId(phoneId)) {
|
if (validatePhoneId(phoneId)) {
|
||||||
mCellLocation[phoneId] = cellLocation;
|
mCellLocation[phoneId] = cellLocation;
|
||||||
@@ -1735,7 +1739,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
if (!checkNotifyPermission("notifyImsCallDisconnectCause()")) {
|
if (!checkNotifyPermission("notifyImsCallDisconnectCause()")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
if (validatePhoneId(phoneId)) {
|
if (validatePhoneId(phoneId)) {
|
||||||
mImsReasonInfo.set(phoneId, imsReasonInfo);
|
mImsReasonInfo.set(phoneId, imsReasonInfo);
|
||||||
@@ -1802,7 +1806,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
if (VDBG) {
|
if (VDBG) {
|
||||||
log("notifySrvccStateChanged: subId=" + subId + " srvccState=" + state);
|
log("notifySrvccStateChanged: subId=" + subId + " srvccState=" + state);
|
||||||
}
|
}
|
||||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
int phoneId = getPhoneIdFromSubId(subId);
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
if (validatePhoneId(phoneId)) {
|
if (validatePhoneId(phoneId)) {
|
||||||
mSrvccState[phoneId] = state;
|
mSrvccState[phoneId] = state;
|
||||||
@@ -2208,7 +2212,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
|
intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
|
||||||
}
|
}
|
||||||
// If the phoneId is invalid, the broadcast is for overall call state.
|
// If the phoneId is invalid, the broadcast is for overall call state.
|
||||||
if (phoneId != SubscriptionManager.INVALID_PHONE_INDEX) {
|
if (phoneId != SubscriptionManager.INVALID_SIM_SLOT_INDEX) {
|
||||||
intent.putExtra(PHONE_CONSTANTS_SLOT_KEY, phoneId);
|
intent.putExtra(PHONE_CONSTANTS_SLOT_KEY, phoneId);
|
||||||
intent.putExtra(SubscriptionManager.EXTRA_SLOT_INDEX, phoneId);
|
intent.putExtra(SubscriptionManager.EXTRA_SLOT_INDEX, phoneId);
|
||||||
}
|
}
|
||||||
@@ -2673,4 +2677,18 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
private static CallQuality createCallQuality() {
|
private static CallQuality createCallQuality() {
|
||||||
return new CallQuality(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
return new CallQuality(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getPhoneIdFromSubId(int subId) {
|
||||||
|
SubscriptionManager subManager = (SubscriptionManager)
|
||||||
|
mContext.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
||||||
|
if (subManager == null) return INVALID_SIM_SLOT_INDEX;
|
||||||
|
|
||||||
|
if (subId == SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) {
|
||||||
|
subId = SubscriptionManager.getDefaultSubscriptionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
SubscriptionInfo info = subManager.getActiveSubscriptionInfo(subId);
|
||||||
|
if (info == null) return INVALID_SIM_SLOT_INDEX;
|
||||||
|
return info.getSimSlotIndex();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1950,9 +1950,18 @@ public class ServiceState implements Parcelable {
|
|||||||
* Returns a copy of self with location-identifying information removed.
|
* Returns a copy of self with location-identifying information removed.
|
||||||
* Always clears the NetworkRegistrationInfo's CellIdentity fields, but if removeCoarseLocation
|
* Always clears the NetworkRegistrationInfo's CellIdentity fields, but if removeCoarseLocation
|
||||||
* is true, clears other info as well.
|
* is true, clears other info as well.
|
||||||
|
*
|
||||||
|
* @param removeCoarseLocation Whether to also remove coarse location information.
|
||||||
|
* if false, it only clears fine location information such as
|
||||||
|
* NetworkRegistrationInfo's CellIdentity fields; If true, it will
|
||||||
|
* also remove other location information such as operator's MCC
|
||||||
|
* and MNC.
|
||||||
|
* @return the copied ServiceState with location info sanitized.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public ServiceState sanitizeLocationInfo(boolean removeCoarseLocation) {
|
@SystemApi
|
||||||
|
@NonNull
|
||||||
|
public ServiceState createLocationInfoSanitizedCopy(boolean removeCoarseLocation) {
|
||||||
ServiceState state = new ServiceState(this);
|
ServiceState state = new ServiceState(this);
|
||||||
synchronized (state.mNetworkRegistrationInfos) {
|
synchronized (state.mNetworkRegistrationInfos) {
|
||||||
List<NetworkRegistrationInfo> networkRegistrationInfos =
|
List<NetworkRegistrationInfo> networkRegistrationInfos =
|
||||||
|
|||||||
@@ -3166,6 +3166,34 @@ public class SubscriptionManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set uicc applications being enabled or disabled.
|
||||||
|
* The value will be remembered on the subscription and will be applied whenever it's present.
|
||||||
|
* If the subscription in currently present, it will also apply the setting to modem
|
||||||
|
* immediately.
|
||||||
|
*
|
||||||
|
* Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
|
||||||
|
*
|
||||||
|
* @param enabled whether uicc applications are enabled or disabled.
|
||||||
|
* @param subscriptionId which subscription to operate on.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
|
||||||
|
public void setUiccApplicationsEnabled(boolean enabled, int subscriptionId) {
|
||||||
|
if (VDBG) {
|
||||||
|
logd("setUiccApplicationsEnabled subId= " + subscriptionId + " enable " + enabled);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
|
||||||
|
if (iSub != null) {
|
||||||
|
iSub.setUiccApplicationsEnabled(enabled, subscriptionId);
|
||||||
|
}
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
// ignore it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether it's supported to disable / re-enable a subscription on a physical (non-euicc) SIM.
|
* Whether it's supported to disable / re-enable a subscription on a physical (non-euicc) SIM.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -285,4 +285,6 @@ interface ISub {
|
|||||||
int getActiveDataSubscriptionId();
|
int getActiveDataSubscriptionId();
|
||||||
|
|
||||||
boolean canDisablePhysicalSubscription();
|
boolean canDisablePhysicalSubscription();
|
||||||
|
|
||||||
|
int setUiccApplicationsEnabled(boolean enabled, int subscriptionId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user