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

Commit b14b72e3 authored by Victor Truong's avatar Victor Truong Committed by Automerger Merge Worker
Browse files

Merge "Remove views from StatusBarView when View is detached." into tm-qpr-dev...

Merge "Remove views from StatusBarView when View is detached." into tm-qpr-dev am: b94e608f am: 162dcbf9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19644306



Change-Id: Ie035cc270dc6a8aa525dd1695fb15d37c35b56d6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 34a84c2a 162dcbf9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ public class DreamOverlayStatusBarView extends ConstraintLayout {
    }

    void setExtraStatusBarItemViews(List<View> views) {
        mSystemStatusViewGroup.removeAllViews();
        removeAllStatusBarItemViews();
        views.forEach(view -> mSystemStatusViewGroup.addView(view));
    }

@@ -121,4 +121,8 @@ public class DreamOverlayStatusBarView extends ConstraintLayout {
        final View statusIcon = findViewById(resId);
        return Objects.requireNonNull(statusIcon);
    }

    void removeAllStatusBarItemViews() {
        mSystemStatusViewGroup.removeAllViews();
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ public class DreamOverlayStatusBarViewController extends ViewController<DreamOve
        mDreamOverlayNotificationCountProvider.ifPresent(
                provider -> provider.removeCallback(mNotificationCountCallback));
        mStatusBarItemsProvider.removeCallback(mStatusBarItemsProviderCallback);
        mView.removeAllStatusBarItemViews();
        mTouchInsetSession.clear();

        mIsAttached = false;
+6 −0
Original line number Diff line number Diff line
@@ -307,6 +307,12 @@ public class DreamOverlayStatusBarViewControllerTest extends SysuiTestCase {
        verify(mDreamOverlayStatusBarItemsProvider).removeCallback(any());
    }

    @Test
    public void testOnViewDetachedRemovesViews() {
        mController.onViewDetached();
        verify(mView).removeAllStatusBarItemViews();
    }

    @Test
    public void testWifiIconHiddenWhenWifiBecomesAvailable() {
        // Make sure wifi starts out unavailable when onViewAttached is called, and then returns