Merge "Adding carrier privilege checks for public ImsMmtelManager APIs"
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 2f0add1..9bef89a 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2975,10 +2975,17 @@
return false;
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ * @param c The callback that will be used to send the result.
+ */
@Override
public void registerImsRegistrationCallback(int subId, IImsRegistrationCallback c)
throws RemoteException {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("registerImsRegistrationCallback");
+
if (!ImsManager.isImsSupportedOnDevice(mApp)) {
throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION,
"IMS not available on device.");
@@ -2995,8 +3002,14 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ * @param c The callback that will be used to send the result.
+ */
@Override
public void unregisterImsRegistrationCallback(int subId, IImsRegistrationCallback c) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("unregisterImsRegistrationCallback");
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
throw new IllegalArgumentException("Invalid Subscription ID: " + subId);
@@ -3053,6 +3066,7 @@
*/
@Override
public void getImsMmTelRegistrationTransportType(int subId, IIntegerConsumer consumer) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("getImsMmTelRegistrationTransportType");
if (!ImsManager.isImsSupportedOnDevice(mApp)) {
throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION,
@@ -3084,9 +3098,15 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ * @param c The callback that will be used to send the result.
+ */
@Override
public void registerMmTelCapabilityCallback(int subId, IImsCapabilityCallback c)
throws RemoteException {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("registerMmTelCapabilityCallback");
if (!ImsManager.isImsSupportedOnDevice(mApp)) {
throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION,
@@ -3104,8 +3124,14 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ * @param c The callback that will be used to send the result.
+ */
@Override
public void unregisterMmTelCapabilityCallback(int subId, IImsCapabilityCallback c) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("unregisterMmTelCapabilityCallback");
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
throw new IllegalArgumentException("Invalid Subscription ID: " + subId);
@@ -3196,9 +3222,15 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ */
@Override
public boolean isAdvancedCallingSettingEnabled(int subId) {
- enforceReadPrivilegedPermission("enforceReadPrivilegedPermission");
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
+ enforceReadPrivilegedPermission("isAdvancedCallingSettingEnabled");
+
// TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
final long token = Binder.clearCallingIdentity();
try {
@@ -3227,8 +3259,13 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ */
@Override
public boolean isVtSettingEnabled(int subId) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("isVtSettingEnabled");
final long identity = Binder.clearCallingIdentity();
try {
@@ -3256,8 +3293,13 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ */
@Override
public boolean isVoWiFiSettingEnabled(int subId) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("isVoWiFiSettingEnabled");
final long identity = Binder.clearCallingIdentity();
try {
@@ -3286,8 +3328,13 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ */
@Override
public boolean isVoWiFiRoamingSettingEnabled(int subId) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("isVoWiFiRoamingSettingEnabled");
final long identity = Binder.clearCallingIdentity();
try {
@@ -3333,8 +3380,13 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ */
@Override
public int getVoWiFiModeSetting(int subId) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("getVoWiFiModeSetting");
final long identity = Binder.clearCallingIdentity();
try {
@@ -3410,8 +3462,13 @@
}
}
+ /**
+ * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
+ * @param subId The subscription to use to check the configuration.
+ */
@Override
public boolean isTtyOverVolteEnabled(int subId) {
+ //TODO: b/147498511 will add TelephonyPermissions#checkCallingOrSelfReadPrecisePhoneState
enforceReadPrivilegedPermission("isTtyOverVolteEnabled");
final long identity = Binder.clearCallingIdentity();
try {