summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();
}