Supported data enabled override for different scenarios
Added override rules support for always allowing mms and
internet data during voice call.
Test: Manual + unit tests
Bug: 132113695
Change-Id: I89653a47565c6e198715e716e3f2c1426e995613
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index ed1de19..d0ed9bd 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -7090,4 +7090,36 @@
Binder.restoreCallingIdentity(identity);
}
}
+
+ @Override
+ public boolean setDataAllowedDuringVoiceCall(int subId, boolean allow) {
+ enforceModifyPermission();
+
+ // Now that all security checks passes, perform the operation as ourselves.
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ Phone phone = getPhone(subId);
+ if (phone == null) return false;
+
+ return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ @Override
+ public boolean isDataAllowedInVoiceCall(int subId) {
+ enforceReadPrivilegedPermission("isDataAllowedInVoiceCall");
+
+ // Now that all security checks passes, perform the operation as ourselves.
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ Phone phone = getPhone(subId);
+ if (phone == null) return false;
+
+ return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
}