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

Commit 3956ceee authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Automerger Merge Worker
Browse files

Merge "Prevent hole in ControlsActivity with panel" into udc-dev am: 896558fe

parents a0df7b3e 896558fe
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ class PanelTaskViewController(
    private val hide: () -> Unit = {}
) {

    init {
        taskView.alpha = 0f
    }

    private var detailTaskId = INVALID_TASK_ID

    private val fillInIntent =
@@ -96,6 +100,7 @@ class PanelTaskViewController(

            override fun onTaskCreated(taskId: Int, name: ComponentName?) {
                detailTaskId = taskId
                taskView.alpha = 1f
            }

            override fun onReleased() {
+16 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.controls.ui

import android.app.ActivityOptions
import android.app.PendingIntent
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK
@@ -89,6 +90,11 @@ class PanelTaskViewControllerTest : SysuiTestCase() {
            )
    }

    @Test
    fun testTaskViewStartsWithAlpha0() {
        verify(taskView).alpha = 0f
    }

    @Test
    fun testLaunchTaskViewAttachedListener() {
        underTest.launchTaskView()
@@ -119,6 +125,16 @@ class PanelTaskViewControllerTest : SysuiTestCase() {
        assertThat(optionsCaptor.value.taskAlwaysOnTop).isTrue()
    }

    @Test
    fun testOnTaskCreated_taskViewAlpha1() {
        underTest.launchTaskView()
        verify(taskView).setListener(any(), capture(listenerCaptor))

        listenerCaptor.value.onTaskCreated(1, ComponentName("Test", "TEST"))

        verify(taskView).alpha = 1f
    }

    @Test
    fun testHideRunnableCalledWhenBackOnRoot() {
        underTest.launchTaskView()