Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b62c7387 authored by Caitlin Cassidy's avatar Caitlin Cassidy
Browse files

[Ongoing Call] Show status bar in immersive if there's an ongoing call.

Test: atest+manual
Bug: 195839150
Change-Id: Ib065a8f4e2f03a98ae52dae386b6a8f08203dcb5
parent db885833
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@

    <bool name="flag_ongoing_call_status_bar_chip">true</bool>

    <bool name="flag_ongoing_call_in_immersive">false</bool>

    <bool name="flag_smartspace">false</bool>

    <bool name="flag_smartspace_deduping">true</bool>
+5 −0
Original line number Diff line number Diff line
@@ -161,6 +161,11 @@ public class FeatureFlags {
        return mFlagReader.isEnabled(R.bool.flag_ongoing_call_status_bar_chip);
    }

    public boolean isOngoingCallInImmersiveEnabled() {
        return isOngoingCallStatusBarChipEnabled()
                && mFlagReader.isEnabled(R.bool.flag_ongoing_call_in_immersive);
    }

    public boolean isSmartspaceEnabled() {
        return mFlagReader.isEnabled(R.bool.flag_smartspace);
    }
+8 −2
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.phone.StatusBarIconController;
import com.android.systemui.statusbar.phone.StatusBarIconControllerImpl;
import com.android.systemui.statusbar.phone.StatusBarRemoteInputCallback;
import com.android.systemui.statusbar.phone.StatusBarWindowController;
import com.android.systemui.statusbar.phone.SystemUIHostDialogProvider;
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController;
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallLogger;
@@ -253,11 +254,16 @@ public interface StatusBarDependenciesModule {
            @Main Executor mainExecutor,
            IActivityManager iActivityManager,
            OngoingCallLogger logger,
            DumpManager dumpManager) {
            DumpManager dumpManager,
            StatusBarWindowController statusBarWindowController) {
        Optional<StatusBarWindowController> windowController =
                featureFlags.isOngoingCallInImmersiveEnabled()
                        ? Optional.of(statusBarWindowController)
                        : Optional.empty();
        OngoingCallController ongoingCallController =
                new OngoingCallController(
                        notifCollection, featureFlags, systemClock, activityStarter, mainExecutor,
                        iActivityManager, logger, dumpManager);
                        iActivityManager, logger, dumpManager, windowController);
        ongoingCallController.init();
        return ongoingCallController;
    }
+10 −1
Original line number Diff line number Diff line
@@ -208,6 +208,12 @@ public class StatusBarWindowController {
        apply(mCurrentState);
    }

    /** Sets whether there is currently an ongoing call. */
    public void setIsCallOngoing(boolean isCallOngoing) {
        mCurrentState.mIsCallOngoing = isCallOngoing;
        apply(mCurrentState);
    }

    /**
     * Return the container in which we should run launch animations started from the status bar and
     * expanding into the opening window.
@@ -248,10 +254,13 @@ public class StatusBarWindowController {
    private static class State {
        boolean mForceStatusBarVisible;
        boolean mIsLaunchAnimationRunning;
        boolean mIsCallOngoing;
    }

    private void applyForceStatusBarVisibleFlag(State state) {
        if (state.mForceStatusBarVisible || state.mIsLaunchAnimationRunning) {
        if (state.mForceStatusBarVisible
                || state.mIsLaunchAnimationRunning
                || state.mIsCallOngoing) {
            mLpChanged.privateFlags |= PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR;
        } else {
            mLpChanged.privateFlags &= ~PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR;
+5 −1
Original line number Diff line number Diff line
@@ -37,10 +37,12 @@ import com.android.systemui.flags.FeatureFlags
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener
import com.android.systemui.statusbar.phone.StatusBarWindowController
import com.android.systemui.statusbar.policy.CallbackController
import com.android.systemui.util.time.SystemClock
import java.io.FileDescriptor
import java.io.PrintWriter
import java.util.Optional
import java.util.concurrent.Executor
import javax.inject.Inject

@@ -57,6 +59,7 @@ class OngoingCallController @Inject constructor(
    private val iActivityManager: IActivityManager,
    private val logger: OngoingCallLogger,
    private val dumpManager: DumpManager,
    private val statusBarWindowController: Optional<StatusBarWindowController>,
) : CallbackController<OngoingCallListener>, Dumpable {

    /** Non-null if there's an active call notification. */
@@ -201,7 +204,7 @@ class OngoingCallController @Inject constructor(
            }

            setUpUidObserver(currentCallNotificationInfo)

            statusBarWindowController.ifPresent { it.setIsCallOngoing(true) }
            mListeners.forEach { l -> l.onOngoingCallStateChanged(animate = true) }
        } else {
            // If we failed to update the chip, don't store the call info. Then [hasOngoingCall]
@@ -268,6 +271,7 @@ class OngoingCallController @Inject constructor(
    private fun removeChip() {
        callNotificationInfo = null
        tearDownChipView()
        statusBarWindowController.ifPresent { it.setIsCallOngoing(false) }
        mListeners.forEach { l -> l.onOngoingCallStateChanged(animate = true) }
        if (uidObserver != null) {
            iActivityManager.unregisterUidObserver(uidObserver)
Loading