summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorEvan Charlton <evanc@google.com>2014-10-20 11:56:38 -0700
committerEvan Charlton <evanc@google.com>2014-10-20 11:56:38 -0700
commit1318d5bf163c6bfb12607a7c5a595e7ee6b35971 (patch)
tree712226b6b09ea5b25f0488fb72d7ae2acaa8968b /InCallUI
parentaec501c9c29db2ef2f2ac885da1462a5916e32b7 (diff)
Allow for callers to subscribe to UI visibility
Expose a callback to allow callers to subscribe to changes of InCallUI's visiblity. Bug: 17736353 Change-Id: I5bf8fd52649358ec2f5aad16742e8186e6970571
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 6f3d1b399..36668cc0a 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -69,6 +69,8 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
private final List<IncomingCallListener> mIncomingCallListeners = new CopyOnWriteArrayList<>();
private final Set<InCallDetailsListener> mDetailsListeners = Collections.newSetFromMap(
new ConcurrentHashMap<InCallDetailsListener, Boolean>(8, 0.9f, 1));
+ private final Set<InCallUiListener> mInCallUiListeners = Collections.newSetFromMap(
+ new ConcurrentHashMap<InCallUiListener, Boolean>(8, 0.9f, 1));
private final Set<InCallOrientationListener> mOrientationListeners = Collections.newSetFromMap(
new ConcurrentHashMap<InCallOrientationListener, Boolean>(8, 0.9f, 1));
private final Set<InCallEventListener> mInCallEventListeners = Collections.newSetFromMap(
@@ -624,6 +626,18 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
if (showing) {
mIsActivityPreviouslyStarted = true;
}
+
+ for (InCallUiListener listener : mInCallUiListeners) {
+ listener.onUiShowing(showing);
+ }
+ }
+
+ public void addInCallUiListener(InCallUiListener listener) {
+ mInCallUiListeners.add(listener);
+ }
+
+ public boolean removeInCallUiListener(InCallUiListener listener) {
+ return mInCallUiListeners.remove(listener);
}
/**
@@ -1153,4 +1167,8 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
public interface InCallEventListener {
public void onFullScreenVideoStateChanged(boolean isFullScreenVideo);
}
+
+ public interface InCallUiListener {
+ void onUiShowing(boolean showing);
+ }
}