summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorEvan Charlton <evanc@google.com>2014-09-12 19:27:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-12 19:27:51 +0000
commit7cf9cb2011280cbf80bfbd0eca62e9d528d8249f (patch)
treeb6b58d49cd471e6f853b0ba4296e81c0ee835db1 /InCallUI
parentc69fe1a6d34a12fa635fee3e0f6b9a93dcc30783 (diff)
parent0e17218005afa23539cd72566dbb03f3dfa17598 (diff)
am d24de9e6: am 1e1ebcdd: am c8d49721: Merge "Send a broadcast when InCallUI is visible" into lmp-dev
* commit 'd24de9e653da59d7c1bca2dc13ee0652df2e4bb9': Send a broadcast when InCallUI is visible
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java12
-rw-r--r--InCallUI/src/com/android/incalluibind/ObjectFactory.java27
2 files changed, 39 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 1d0ec8762..ad78708cc 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -16,6 +16,7 @@
package com.android.incallui;
+import android.Manifest;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
@@ -30,6 +31,8 @@ import android.view.View;
import com.google.common.base.Preconditions;
+import com.android.incalluibind.ObjectFactory;
+
import java.util.Collections;
import java.util.List;
import java.util.Locale;
@@ -48,6 +51,9 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/
public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
+ private static final String EXTRA_FIRST_TIME_SHOWN =
+ "com.android.incallui.intent.extra.FIRST_TIME_SHOWN";
+
private static InCallPresenter sInCallPresenter;
/**
@@ -598,6 +604,12 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
}
if (showing) {
+ Intent broadcastIntent = ObjectFactory.getUiReadyBroadcastIntent();
+ if (broadcastIntent != null) {
+ broadcastIntent.putExtra(EXTRA_FIRST_TIME_SHOWN, !mIsActivityPreviouslyStarted);
+ mContext.sendBroadcast(broadcastIntent, Manifest.permission.READ_PHONE_STATE);
+ }
+
mIsActivityPreviouslyStarted = true;
}
}
diff --git a/InCallUI/src/com/android/incalluibind/ObjectFactory.java b/InCallUI/src/com/android/incalluibind/ObjectFactory.java
new file mode 100644
index 000000000..5813ce9e6
--- /dev/null
+++ b/InCallUI/src/com/android/incalluibind/ObjectFactory.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.incalluibind;
+
+import android.content.Intent;
+
+public class ObjectFactory {
+
+ /** @return An {@link Intent} to be broadcast when the InCallUI is visible. */
+ public static Intent getUiReadyBroadcastIntent() {
+ return null;
+ }
+}