Hi all,
I found that Android Setting application can change Locale, and the built-in
application uses the following code to do that:
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
try {
IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
Loc loc = mLocales[position];
config.locale = loc.locale;
// indicate this isn't some passing default - the user wants this
remembered
config.userSetLocale = true;
am.updateConfiguration(config);
} catch (RemoteException e) {
// Intentionally left blank
}
finish();
}
/**
* System private API for talking with the activity manager service. This
* provides calls from the application back to the activity manager.
*
* {...@hide}
*/
public interface IActivityManager extends IInterface {
}
>From the SDK documentation we can see that Configuration structure (and
>reader) is public API and the permission that claims to allow an application
>to set Locale is public (user.permission.write_setting) but IActivityManager
>is hidden and not included in SDK. So the setting interface API
>IActivityManager.updateConfiguration() is not public API of SDK.
Is there intended to be a public API that allows application developers to
create applications that set system locale?
We are trying to resolve ambiguities in the API specifications regarding what
APIs are intended to be visible to application developers.
So I am wondering that is there way to invoke an
IActivityManager.updateConfiguration() using public API of SDK? (I think there
is not a way in the cupcake API ).
Does AOSP plan to have a public API that allows application developers to set
System Locale? If no, what is the purpose of the comment regarding
(user.permission.write_setting) that says that it allows setting locale.
Thanks
Tim
Intel Software Services Group (SSG)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"android-framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---