Merge changes Idf152091,I131f7aff

am: 6e2ecfeede

Change-Id: Ifbe29576a1d830229c78c78470f39f20cd59e5db
This commit is contained in:
Sooraj Sasindran
2019-12-03 17:00:46 -08:00
committed by android-build-merger
5 changed files with 125 additions and 43 deletions

View File

@@ -44965,6 +44965,7 @@ package android.telephony {
method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.os.ParcelUuid createSubscriptionGroup(@NonNull java.util.List<java.lang.Integer>); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.os.ParcelUuid createSubscriptionGroup(@NonNull java.util.List<java.lang.Integer>);
method @Deprecated public static android.telephony.SubscriptionManager from(android.content.Context); method @Deprecated public static android.telephony.SubscriptionManager from(android.content.Context);
method public java.util.List<android.telephony.SubscriptionInfo> getAccessibleSubscriptionInfoList(); method public java.util.List<android.telephony.SubscriptionInfo> getAccessibleSubscriptionInfoList();
method @Nullable public java.util.List<android.telephony.SubscriptionInfo> getActiveAndHiddenSubscriptionInfoList();
method public static int getActiveDataSubscriptionId(); method public static int getActiveDataSubscriptionId();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfo(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfo(int);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getActiveSubscriptionInfoCount(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getActiveSubscriptionInfoCount();

View File

@@ -8559,6 +8559,7 @@ package android.telephony {
public class SubscriptionInfo implements android.os.Parcelable { public class SubscriptionInfo implements android.os.Parcelable {
method @Nullable public java.util.List<android.telephony.UiccAccessRule> getAccessRules(); method @Nullable public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
method public int getProfileClass(); method public int getProfileClass();
method public boolean isGroupDisabled();
} }
public class SubscriptionManager { public class SubscriptionManager {
@@ -8674,7 +8675,9 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled();
method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isInEmergencySmsMode(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isInEmergencySmsMode();
method public boolean isModemEnabledForSlot(int);
method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isOpportunisticNetworkEnabled();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String);
method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn();
method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
@@ -8696,6 +8699,7 @@ package android.telephony {
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunisticNetworkState(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setPreferredNetworkTypeBitmask(long); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setPreferredNetworkTypeBitmask(long);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadioPower(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadioPower(boolean);

View File

@@ -654,6 +654,7 @@ public class SubscriptionInfo implements Parcelable {
* Return whether the subscription's group is disabled. * Return whether the subscription's group is disabled.
* @hide * @hide
*/ */
@SystemApi
public boolean isGroupDisabled() { public boolean isGroupDisabled() {
return mIsGroupDisabled; return mIsGroupDisabled;
} }

View File

@@ -51,12 +51,10 @@ 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;
import android.os.ServiceManager; import android.os.ServiceManager;
import android.telephony.Annotation.NetworkType;
import android.telephony.euicc.EuiccManager; import android.telephony.euicc.EuiccManager;
import android.telephony.ims.ImsMmTelManager; import android.telephony.ims.ImsMmTelManager;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
@@ -1292,12 +1290,32 @@ public class SubscriptionManager {
} }
/** /**
* This is similar to {@link #getActiveSubscriptionInfoList()}, but if userVisibleOnly * Get both hidden and visible SubscriptionInfo(s) of the currently active SIM(s).
* is true, it will filter out the hidden subscriptions. * The records will be sorted by {@link SubscriptionInfo#getSimSlotIndex}
* then by {@link SubscriptionInfo#getSubscriptionId}.
*
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* or that the calling app has carrier privileges (see
* {@link TelephonyManager#hasCarrierPrivileges}). In the latter case, only records accessible
* to the calling app are returned.
*
* @return Sorted list of the currently available {@link SubscriptionInfo}
* records on the device.
* This is similar to {@link #getActiveSubscriptionInfoList} except that it will return
* both active and hidden SubscriptionInfos.
* *
* @hide
*/ */
public List<SubscriptionInfo> getActiveSubscriptionInfoList(boolean userVisibleOnly) { public @Nullable List<SubscriptionInfo> getActiveAndHiddenSubscriptionInfoList() {
return getActiveSubscriptionInfoList(/* userVisibleonly */false);
}
/**
* This is similar to {@link #getActiveSubscriptionInfoList()}, but if userVisibleOnly
* is true, it will filter out the hidden subscriptions.
*
* @hide
*/
public @Nullable List<SubscriptionInfo> getActiveSubscriptionInfoList(boolean userVisibleOnly) {
List<SubscriptionInfo> activeList = null; List<SubscriptionInfo> activeList = null;
try { try {
@@ -2685,9 +2703,14 @@ public class SubscriptionManager {
if (executor == null || callback == null) { if (executor == null || callback == null) {
return; return;
} }
Binder.withCleanCallingIdentity(() -> executor.execute(() -> { final long identity = Binder.clearCallingIdentity();
callback.accept(result); try {
})); executor.execute(() -> {
callback.accept(result);
});
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
}; };
iSub.setPreferredDataSubscriptionId(subId, needValidation, callbackStub); iSub.setPreferredDataSubscriptionId(subId, needValidation, callbackStub);

View File

@@ -5539,16 +5539,24 @@ public class TelephonyManager {
new ICellInfoCallback.Stub() { new ICellInfoCallback.Stub() {
@Override @Override
public void onCellInfo(List<CellInfo> cellInfo) { public void onCellInfo(List<CellInfo> cellInfo) {
Binder.withCleanCallingIdentity(() -> final long identity = Binder.clearCallingIdentity();
executor.execute(() -> callback.onCellInfo(cellInfo))); try {
executor.execute(() -> callback.onCellInfo(cellInfo));
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
@Override @Override
public void onError(int errorCode, String exceptionName, String message) { public void onError(int errorCode, String exceptionName, String message) {
Binder.withCleanCallingIdentity(() -> final long identity = Binder.clearCallingIdentity();
executor.execute(() -> callback.onError( try {
errorCode, executor.execute(() -> callback.onError(
createThrowableByClassName(exceptionName, message)))); errorCode,
createThrowableByClassName(exceptionName, message)));
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
}, getOpPackageName()); }, getOpPackageName());
} catch (RemoteException ex) { } catch (RemoteException ex) {
@@ -5581,16 +5589,25 @@ public class TelephonyManager {
new ICellInfoCallback.Stub() { new ICellInfoCallback.Stub() {
@Override @Override
public void onCellInfo(List<CellInfo> cellInfo) { public void onCellInfo(List<CellInfo> cellInfo) {
Binder.withCleanCallingIdentity(() -> final long identity = Binder.clearCallingIdentity();
executor.execute(() -> callback.onCellInfo(cellInfo))); try {
executor.execute(() -> callback.onCellInfo(cellInfo));
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
@Override @Override
public void onError(int errorCode, String exceptionName, String message) { public void onError(int errorCode, String exceptionName, String message) {
Binder.withCleanCallingIdentity(() -> final long identity = Binder.clearCallingIdentity();
executor.execute(() -> callback.onError( try {
errorCode, executor.execute(() -> callback.onError(
createThrowableByClassName(exceptionName, message)))); errorCode,
createThrowableByClassName(exceptionName, message)));
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
}, getOpPackageName(), workSource); }, getOpPackageName(), workSource);
} catch (RemoteException ex) { } catch (RemoteException ex) {
@@ -6455,16 +6472,24 @@ public class TelephonyManager {
INumberVerificationCallback internalCallback = new INumberVerificationCallback.Stub() { INumberVerificationCallback internalCallback = new INumberVerificationCallback.Stub() {
@Override @Override
public void onCallReceived(String phoneNumber) { public void onCallReceived(String phoneNumber) {
Binder.withCleanCallingIdentity(() -> final long identity = Binder.clearCallingIdentity();
executor.execute(() -> try {
callback.onCallReceived(phoneNumber))); executor.execute(() ->
callback.onCallReceived(phoneNumber));
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
@Override @Override
public void onVerificationFailed(int reason) { public void onVerificationFailed(int reason) {
Binder.withCleanCallingIdentity(() -> final long identity = Binder.clearCallingIdentity();
executor.execute(() -> try {
callback.onVerificationFailed(reason))); executor.execute(() ->
callback.onVerificationFailed(reason));
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
}; };
@@ -10678,6 +10703,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@SystemApi
public boolean setOpportunisticNetworkState(boolean enable) { public boolean setOpportunisticNetworkState(boolean enable) {
String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>";
boolean ret = false; boolean ret = false;
@@ -10705,6 +10731,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@SystemApi
public boolean isOpportunisticNetworkEnabled() { public boolean isOpportunisticNetworkEnabled() {
String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>";
boolean isEnabled = false; boolean isEnabled = false;
@@ -11266,9 +11293,14 @@ public class TelephonyManager {
if (executor == null || callback == null) { if (executor == null || callback == null) {
return; return;
} }
Binder.withCleanCallingIdentity(() -> executor.execute(() -> { final long identity = Binder.clearCallingIdentity();
callback.accept(SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION); try {
})); executor.execute(() -> {
callback.accept(SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION);
});
} finally {
Binder.restoreCallingIdentity(identity);
}
return; return;
} }
ISetOpportunisticDataCallback callbackStub = new ISetOpportunisticDataCallback.Stub() { ISetOpportunisticDataCallback callbackStub = new ISetOpportunisticDataCallback.Stub() {
@@ -11277,9 +11309,14 @@ public class TelephonyManager {
if (executor == null || callback == null) { if (executor == null || callback == null) {
return; return;
} }
Binder.withCleanCallingIdentity(() -> executor.execute(() -> { final long identity = Binder.clearCallingIdentity();
callback.accept(result); try {
})); executor.execute(() -> {
callback.accept(result);
});
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
}; };
@@ -11351,14 +11388,24 @@ public class TelephonyManager {
return; return;
} }
if (iOpportunisticNetworkService == null) { if (iOpportunisticNetworkService == null) {
/* Todo<b/130595455> passing unknown due to lack of good error codes */ final long identity = Binder.clearCallingIdentity();
Binder.withCleanCallingIdentity(() -> executor.execute(() -> { try {
callback.accept(UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE); /* Todo<b/130595455> passing unknown due to lack of good error codes */
})); executor.execute(() -> {
callback.accept(UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE);
});
} finally {
Binder.restoreCallingIdentity(identity);
}
} else { } else {
Binder.withCleanCallingIdentity(() -> executor.execute(() -> { final long identity = Binder.clearCallingIdentity();
callback.accept(UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS); try {
})); executor.execute(() -> {
callback.accept(UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS);
});
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
return; return;
} }
@@ -11369,9 +11416,14 @@ public class TelephonyManager {
if (executor == null || callback == null) { if (executor == null || callback == null) {
return; return;
} }
Binder.withCleanCallingIdentity(() -> executor.execute(() -> { final long identity = Binder.clearCallingIdentity();
callback.accept(result); try {
})); executor.execute(() -> {
callback.accept(result);
});
} finally {
Binder.restoreCallingIdentity(identity);
}
} }
}; };
iOpportunisticNetworkService.updateAvailableNetworks(availableNetworks, callbackStub, iOpportunisticNetworkService.updateAvailableNetworks(availableNetworks, callbackStub,
@@ -11417,6 +11469,7 @@ public class TelephonyManager {
* @param slotIndex which slot it's checking. * @param slotIndex which slot it's checking.
* @hide * @hide
*/ */
@SystemApi
public boolean isModemEnabledForSlot(int slotIndex) { public boolean isModemEnabledForSlot(int slotIndex) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();