Use BroadcastReceiver to listen for LOCALE_CHANGED

Previously, we used the service to listen to Intent.ACTION_LOCALE_CHANGED.
This never worked because that intent is broadcasted by the system
and so Services will never receive them. Just use the existing forwarding
infrastructure to send the broadcast to the service.

Change-Id: I50ef625804e76e2348d3fe14686778d54463b78d
This commit is contained in:
Andrew Sapperstein 2014-03-04 15:55:52 -08:00
parent 001e4ea42c
commit 19b7e95d64
2 changed files with 3 additions and 2 deletions

View File

@ -410,6 +410,7 @@
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.DEVICE_STORAGE_LOW" />
<action android:name="android.intent.action.DEVICE_STORAGE_OK" />
<action android:name="android.intent.action.LOCALE_CHANGED"/>
<action android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" />
</intent-filter>
<!-- To handle new message notifications -->
@ -668,7 +669,6 @@
<service android:name="com.android.email.EmailIntentService"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.LOCALE_CHANGED"/>
<action android:name="com.android.mail.action.RESEND_NOTIFICATIONS" />
</intent-filter>
<intent-filter>

View File

@ -138,7 +138,8 @@ public class EmailBroadcastProcessorService extends IntentService {
AccountSettings.actionSettingsWithDebug(this);
} else if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(broadcastAction)) {
onSystemAccountChanged();
} else if (UIProvider.ACTION_UPDATE_NOTIFICATION.equals((broadcastAction))) {
} else if (Intent.ACTION_LOCALE_CHANGED.equals(broadcastAction) ||
UIProvider.ACTION_UPDATE_NOTIFICATION.equals((broadcastAction))) {
broadcastIntent.setClass(this, EmailIntentService.class);
startService(broadcastIntent);
}