Add a hidden telephony API for querying SIM derived locales.

bug: 19818550
Change-Id: Ide6c05ad8fe7b0cff6f20ddfe755e83e9b3a21aa
This commit is contained in:
Narayan Kamath
2015-04-16 14:32:53 +01:00
parent 25d9f5f316
commit 7ff76d637f
2 changed files with 22 additions and 0 deletions

View File

@@ -4580,4 +4580,18 @@ public class TelephonyManager {
} catch (RemoteException e) { } catch (RemoteException e) {
} }
} }
/** @hide */
public String getLocaleFromDefaultSim() {
try {
final ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getLocaleFromDefaultSim();
}
} catch (RemoteException ex) {
}
return null;
}
} }

View File

@@ -945,4 +945,12 @@ interface ITelephony {
int getSubIdForPhoneAccount(in PhoneAccount phoneAccount); int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
void factoryReset(int subId); 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();
} }