summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Charlton <evanc@google.com>2014-09-15 22:13:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-15 22:13:43 +0000
commit4a111a07023891fc1e56d71afe41b942aa5417f0 (patch)
tree8cb8fd06bbf7c29945cf7de2c726f68380ac0746
parent83f012b78f125279d566f6428c337e588e89b6b8 (diff)
parentdcc27f8caed782f9f04ae3f8c5eba47eecad74ed (diff)
Merge "Switch InCallUI broadcast to be sticky" into lmp-dev
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 241056d89..3342c7d6b 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -603,13 +603,20 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
mProximitySensor.onInCallShowing(showing);
}
- if (showing) {
- Intent broadcastIntent = ObjectFactory.getUiReadyBroadcastIntent();
- if (broadcastIntent != null) {
- broadcastIntent.putExtra(EXTRA_FIRST_TIME_SHOWN, !mIsActivityPreviouslyStarted);
- mContext.sendBroadcast(broadcastIntent, Manifest.permission.READ_PHONE_STATE);
+ Intent broadcastIntent = ObjectFactory.getUiReadyBroadcastIntent();
+ if (broadcastIntent != null) {
+ broadcastIntent.putExtra(EXTRA_FIRST_TIME_SHOWN, !mIsActivityPreviouslyStarted);
+
+ if (showing) {
+ Log.d(this, "Sending sticky broadcast: ", broadcastIntent);
+ mContext.sendStickyBroadcast(broadcastIntent);
+ } else {
+ Log.d(this, "Removing sticky broadcast: ", broadcastIntent);
+ mContext.removeStickyBroadcast(broadcastIntent);
}
+ }
+ if (showing) {
mIsActivityPreviouslyStarted = true;
}
}