summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/MmsServiceBroker.java
diff options
context:
space:
mode:
authorYe Wen <ywen@google.com>2014-08-01 13:38:58 -0700
committerYe Wen <ywen@google.com>2014-08-01 13:57:31 -0700
commit63c00c4379ba4ac0f50161980b67c8acc2548f7b (patch)
tree29ef86e84dfd38b7e084d723d9e67670aa1a1324 /services/core/java/com/android/server/MmsServiceBroker.java
parentbfa96fb3820201749dc4366b1b14788c88892755 (diff)
downloadframeworks_base-63c00c4379ba4ac0f50161980b67c8acc2548f7b.zip
frameworks_base-63c00c4379ba4ac0f50161980b67c8acc2548f7b.tar.gz
frameworks_base-63c00c4379ba4ac0f50161980b67c8acc2548f7b.tar.bz2
Allow MmsConfig override per request (1/3)
Instead of providing ways to override MmsConfig globally, this allows the override per request, which is safer. Also added subId to the getter of MessagingConfigurationManager. b/16681649 Change-Id: Ia5ee391e2fa51fbdf87d111174d8df21f5f5e41f
Diffstat (limited to 'services/core/java/com/android/server/MmsServiceBroker.java')
-rw-r--r--services/core/java/com/android/server/MmsServiceBroker.java60
1 files changed, 16 insertions, 44 deletions
diff --git a/services/core/java/com/android/server/MmsServiceBroker.java b/services/core/java/com/android/server/MmsServiceBroker.java
index 898b6f1..df54c7f 100644
--- a/services/core/java/com/android/server/MmsServiceBroker.java
+++ b/services/core/java/com/android/server/MmsServiceBroker.java
@@ -191,25 +191,28 @@ public class MmsServiceBroker extends SystemService {
private final class BinderService extends IMms.Stub {
@Override
public void sendMessage(long subId, String callingPkg, byte[] pdu, String locationUrl,
- PendingIntent sentIntent) throws RemoteException {
+ ContentValues configOverrides, PendingIntent sentIntent) throws RemoteException {
mContext.enforceCallingPermission(Manifest.permission.SEND_SMS, "Send MMS message");
if (getAppOpsManager().noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(),
callingPkg) != AppOpsManager.MODE_ALLOWED) {
return;
}
- getServiceGuarded().sendMessage(subId, callingPkg, pdu, locationUrl, sentIntent);
+ getServiceGuarded().sendMessage(subId, callingPkg, pdu, locationUrl, configOverrides,
+ sentIntent);
}
@Override
public void downloadMessage(long subId, String callingPkg, String locationUrl,
- PendingIntent downloadedIntent) throws RemoteException {
+ ContentValues configOverrides, PendingIntent downloadedIntent)
+ throws RemoteException {
mContext.enforceCallingPermission(Manifest.permission.RECEIVE_MMS,
"Download MMS message");
if (getAppOpsManager().noteOp(AppOpsManager.OP_RECEIVE_MMS, Binder.getCallingUid(),
callingPkg) != AppOpsManager.MODE_ALLOWED) {
return;
}
- getServiceGuarded().downloadMessage(subId, callingPkg, locationUrl, downloadedIntent);
+ getServiceGuarded().downloadMessage(subId, callingPkg, locationUrl, configOverrides,
+ downloadedIntent);
}
@Override
@@ -225,53 +228,21 @@ public class MmsServiceBroker extends SystemService {
}
@Override
- public boolean getCarrierConfigBoolean(String name, boolean defaultValue)
- throws RemoteException {
- return getServiceGuarded().getCarrierConfigBoolean(name, defaultValue);
- }
-
- @Override
- public int getCarrierConfigInt(String name, int defaultValue) throws RemoteException {
- return getServiceGuarded().getCarrierConfigInt(name, defaultValue);
- }
-
- @Override
- public String getCarrierConfigString(String name, String defaultValue)
- throws RemoteException {
- return getServiceGuarded().getCarrierConfigString(name, defaultValue);
- }
-
- @Override
- public void setCarrierConfigBoolean(String callingPkg, String name, boolean value)
+ public boolean getCarrierConfigBoolean(long subId, String name, boolean defaultValue)
throws RemoteException {
- mContext.enforceCallingPermission(Manifest.permission.SEND_SMS, "Set MMS config");
- if (getAppOpsManager().noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(),
- callingPkg) != AppOpsManager.MODE_ALLOWED) {
- return;
- }
- getServiceGuarded().setCarrierConfigBoolean(callingPkg, name, value);
+ return getServiceGuarded().getCarrierConfigBoolean(subId, name, defaultValue);
}
@Override
- public void setCarrierConfigInt(String callingPkg, String name, int value)
+ public int getCarrierConfigInt(long subId, String name, int defaultValue)
throws RemoteException {
- mContext.enforceCallingPermission(Manifest.permission.SEND_SMS, "Set MMS config");
- if (getAppOpsManager().noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(),
- callingPkg) != AppOpsManager.MODE_ALLOWED) {
- return;
- }
- getServiceGuarded().setCarrierConfigInt(callingPkg, name, value);
+ return getServiceGuarded().getCarrierConfigInt(subId, name, defaultValue);
}
@Override
- public void setCarrierConfigString(String callingPkg, String name, String value)
+ public String getCarrierConfigString(long subId, String name, String defaultValue)
throws RemoteException {
- mContext.enforceCallingPermission(Manifest.permission.SEND_SMS, "Set MMS config");
- if (getAppOpsManager().noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(),
- callingPkg) != AppOpsManager.MODE_ALLOWED) {
- return;
- }
- getServiceGuarded().setCarrierConfigString(callingPkg, name, value);
+ return getServiceGuarded().getCarrierConfigString(subId, name, defaultValue);
}
@Override
@@ -370,14 +341,15 @@ public class MmsServiceBroker extends SystemService {
@Override
public void sendStoredMessage(long subId, String callingPkg, Uri messageUri,
- PendingIntent sentIntent) throws RemoteException {
+ ContentValues configOverrides, PendingIntent sentIntent) throws RemoteException {
mContext.enforceCallingPermission(Manifest.permission.SEND_SMS,
"Send stored MMS message");
if (getAppOpsManager().noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(),
callingPkg) != AppOpsManager.MODE_ALLOWED) {
return;
}
- getServiceGuarded().sendStoredMessage(subId, callingPkg, messageUri, sentIntent);
+ getServiceGuarded().sendStoredMessage(subId, callingPkg, messageUri, configOverrides,
+ sentIntent);
}
@Override