summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-04-16 14:32:53 +0100
committerNarayan Kamath <narayan@google.com>2015-05-28 08:59:27 +0000
commit7ff76d637f5ad49838e9d4a1570c762a187ed4d1 (patch)
treeb52e309e9d5dc7f756b681b74eb4274c91788782 /telephony/java
parent25d9f5f3162d8b3a0e167cdd4408164208cd303c (diff)
downloadframeworks_base-7ff76d637f5ad49838e9d4a1570c762a187ed4d1.zip
frameworks_base-7ff76d637f5ad49838e9d4a1570c762a187ed4d1.tar.gz
frameworks_base-7ff76d637f5ad49838e9d4a1570c762a187ed4d1.tar.bz2
Add a hidden telephony API for querying SIM derived locales.
bug: 19818550 Change-Id: Ide6c05ad8fe7b0cff6f20ddfe755e83e9b3a21aa
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java14
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl8
2 files changed, 22 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index fbc70de..a47f5e9 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -4580,4 +4580,18 @@ public class TelephonyManager {
} catch (RemoteException e) {
}
}
+
+
+ /** @hide */
+ public String getLocaleFromDefaultSim() {
+ try {
+ final ITelephony telephony = getITelephony();
+ if (telephony != null) {
+ return telephony.getLocaleFromDefaultSim();
+ }
+ } catch (RemoteException ex) {
+ }
+
+ return null;
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 25fe97c..11d0ea6 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -945,4 +945,12 @@ interface ITelephony {
int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
void factoryReset(int subId);
+
+ /**
+ * An estimate of the users's current locale based on the default SIM.
+ *
+ * The returned string will be a well formed BCP-47 language tag, or {@code null}
+ * if no locale could be derived.
+ */
+ String getLocaleFromDefaultSim();
}