summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorShishir Agrawal <shishir@google.com>2014-07-17 16:31:37 -0700
committerShishir Agrawal <shishir@google.com>2014-07-17 16:31:37 -0700
commit86578cca383562c72751d747905280afdeb2bdfb (patch)
tree9a1f4a27e7b0f7107c95518424c887cebeb26d7b /telephony/java
parent38d3c26fd57a9dc6f4ac09827120b713ceb04ebe (diff)
downloadframeworks_base-86578cca383562c72751d747905280afdeb2bdfb.zip
frameworks_base-86578cca383562c72751d747905280afdeb2bdfb.tar.gz
frameworks_base-86578cca383562c72751d747905280afdeb2bdfb.tar.bz2
Adding the ability for carrier app to override SPN and carrier name.
The change allows system apps (holding MODIFY_PHONE_STATE permission) or carrier apps to override the "carrier branding" on a per ICCID basis. The override affects the service provider name as well as the network operator name. The override is also saved as a SharedPreference and will persist for the iccId across reboots. Change-Id: I985ba247e10e2501e3d0d21567ccadc46f365879
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java28
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl18
2 files changed, 46 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 5e6cb14..4cefb81 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -2935,6 +2935,34 @@ public class TelephonyManager {
}
/**
+ * Override the branding for the input ICCID.
+ *
+ * Once set, whenever the ICCID is inserted into the device, the service
+ * provider name (SPN) and the operator name will both be replaced by the
+ * brand value input. To unset the value, the same function should be
+ * called with a null brand value.
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * or has to be carrier app - see #hasCarrierPrivileges.
+ *
+ * @param iccId The ICCID of that the branding applies to.
+ * @param brand The brand name to display/set.
+ * @return true if the operation was executed correctly.
+ */
+ public boolean setOperatorBrandOverride(String iccId, String brand) {
+ // TODO: Validate ICCID format.
+ try {
+ return getITelephony().setOperatorBrandOverride(iccId, brand);
+ } catch (RemoteException ex) {
+ Rlog.e(TAG, "setOperatorBrandOverride RemoteException", ex);
+ } catch (NullPointerException ex) {
+ Rlog.e(TAG, "setOperatorBrandOverride NPE", ex);
+ }
+ return false;
+ }
+
+ /**
* Expose the rest of ITelephony to @SystemApi
*/
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index d41ceda..435c334 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -706,5 +706,23 @@ interface ITelephony {
* not set.
*/
String getLine1AlphaTagForDisplay(long subId);
+
+ /**
+ * Override the operator branding for the input ICCID.
+ *
+ * Once set, whenever the ICCID is inserted into the device, the service
+ * provider name (SPN) and the operator name will both be replaced by the
+ * brand value input. To unset the value, the same function should be
+ * called with a null brand value.
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ * or has to be carrier app - see #hasCarrierPrivileges.
+ *
+ * @param iccid The ICCID of that the branding applies to.
+ * @param brand The brand name to display/set.
+ * @return true if the operation was executed correctly.
+ */
+ boolean setOperatorBrandOverride(String iccId, String brand);
}