summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-12-08 19:45:14 -0800
committerDianne Hackborn <hackbod@google.com>2009-12-14 15:03:35 -0800
commit1c633fc89bae9bf0af6fe643ac7ad2e744f27bed (patch)
treeba72742fc17755ec69996ad3dd6a6f82f445a2ab /media/java
parent19553241513bd2ee2610026ebbce8c45c7ae0dbc (diff)
downloadframeworks_base-1c633fc89bae9bf0af6fe643ac7ad2e744f27bed.zip
frameworks_base-1c633fc89bae9bf0af6fe643ac7ad2e744f27bed.tar.gz
frameworks_base-1c633fc89bae9bf0af6fe643ac7ad2e744f27bed.tar.bz2
Implement API to have new broadcasts replace existing broadcasts.
Use this in various places where it should serve no purpose to deliver both broadcasts. This is intended to reduce somewhat the flurry of broadcasts that we churn through during boot.
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/AudioService.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index b41f3e2..e5837ee 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -892,13 +892,13 @@ public class AudioService extends IAudioService.Stub {
private void broadcastRingerMode() {
// Send sticky broadcast
- if (ActivityManagerNative.isSystemReady()) {
- Intent broadcast = new Intent(AudioManager.RINGER_MODE_CHANGED_ACTION);
- broadcast.putExtra(AudioManager.EXTRA_RINGER_MODE, mRingerMode);
- long origCallerIdentityToken = Binder.clearCallingIdentity();
- mContext.sendStickyBroadcast(broadcast);
- Binder.restoreCallingIdentity(origCallerIdentityToken);
- }
+ Intent broadcast = new Intent(AudioManager.RINGER_MODE_CHANGED_ACTION);
+ broadcast.putExtra(AudioManager.EXTRA_RINGER_MODE, mRingerMode);
+ broadcast.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
+ | Intent.FLAG_RECEIVER_REPLACE_PENDING);
+ long origCallerIdentityToken = Binder.clearCallingIdentity();
+ mContext.sendStickyBroadcast(broadcast);
+ Binder.restoreCallingIdentity(origCallerIdentityToken);
}
private void broadcastVibrateSetting(int vibrateType) {