diff options
author | Eric Erfanian <erfanian@google.com> | 2017-04-06 23:16:42 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-06 23:16:42 +0000 |
commit | 28188020060d1ad3304dfa0367486ff5bb35da62 (patch) | |
tree | 8d08d4f2292aa84dc435d455891e7ab633d95a25 /java/com/android/incallui/InCallPresenter.java | |
parent | 34e183cfd77f68e0ade42d2080c76f54a319430d (diff) | |
parent | 01a86435499d66b267765f89b7dd9c83c158ddfe (diff) |
Update AOSP Dialer source from internal google3 repository at cl/152373142. am: d8046e520a
am: 01a8643549
Change-Id: Ib92542e6b88bc8d8906982280244661ed7dbca8f
Diffstat (limited to 'java/com/android/incallui/InCallPresenter.java')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index db4d88486..d3d839909 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -40,6 +40,7 @@ import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener; import com.android.dialer.blocking.FilteredNumbersUtil; import com.android.dialer.common.LogUtil; +import com.android.dialer.enrichedcall.EnrichedCallComponent; import com.android.dialer.logging.Logger; import com.android.dialer.logging.nano.InteractionEvent; import com.android.dialer.postcall.PostCall; @@ -320,6 +321,9 @@ public class InCallPresenter implements CallList.Listener { mStatusBarNotifier = statusBarNotifier; mExternalCallNotifier = externalCallNotifier; addListener(mStatusBarNotifier); + EnrichedCallComponent.get(mContext) + .getEnrichedCallManager() + .registerStateChangedListener(mStatusBarNotifier); mProximitySensor = proximitySensor; addListener(mProximitySensor); @@ -1003,7 +1007,10 @@ public class InCallPresenter implements CallList.Listener { void onActivityStarted() { Log.d(this, "onActivityStarted"); notifyVideoPauseController(true); - mStatusBarNotifier.updateNotification(mCallList); + if (mStatusBarNotifier != null) { + // TODO - b/36649622: Investigate this redundant call + mStatusBarNotifier.updateNotification(mCallList); + } } /*package*/ @@ -1297,12 +1304,7 @@ public class InCallPresenter implements CallList.Listener { } else if (startIncomingCallSequence) { Log.i(this, "Start Full Screen in call UI"); - if (!startUi()) { - // startUI refused to start the UI. This indicates that it needed to restart the - // activity. When it finally restarts, it will call us back, so we do not actually - // change the state yet (we return mInCallState instead of newState). - return mInCallState; - } + mStatusBarNotifier.updateNotification(mCallList); } else if (newState == InCallState.NO_CALLS) { // The new state is the no calls state. Tear everything down. attemptFinishActivity(); @@ -1339,18 +1341,6 @@ public class InCallPresenter implements CallList.Listener { } } - private boolean startUi() { - boolean isCallWaiting = - mCallList.getActiveCall() != null && mCallList.getIncomingCall() != null; - - if (isCallWaiting) { - showInCall(false, false); - } else { - mStatusBarNotifier.updateNotification(mCallList); - } - return true; - } - /** * @return {@code true} if the InCallPresenter is ready to be torn down, {@code false} otherwise. * Calling classes should use this as an indication whether to interact with the @@ -1387,7 +1377,11 @@ public class InCallPresenter implements CallList.Listener { if (mStatusBarNotifier != null) { removeListener(mStatusBarNotifier); + EnrichedCallComponent.get(mContext) + .getEnrichedCallManager() + .unregisterStateChangedListener(mStatusBarNotifier); } + if (mExternalCallNotifier != null && mExternalCallList != null) { mExternalCallList.removeExternalCallListener(mExternalCallNotifier); } |