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

Commit 896558fe authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Prevent hole in ControlsActivity with panel" into udc-dev

parents 7229904e 3ec2dd1e
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()