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

Commit 2f16ed67 authored by Lucas Silva's avatar Lucas Silva
Browse files

Fix home panel dream orientation changes

Instead of passing a fixed size to the task fragment, we now pass an
empty size. Empty sizes are special-cased to mean "fill entire parent",
and will automatically handle orientation changes.

Fixes: 323885770
Test: flashed device and verified with the flag on
Flag: ACONFIG android.service.controls.flags.home_panel_dream TRUNKFOOD

Change-Id: Ie2268cb2f65ffe2ace34a81c14918a19cce2f8d4
parent 60fdaef6
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.systemui.dreams.homecontrols

import android.app.Activity
import android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW
import android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN
import android.content.Intent
import android.graphics.Rect
import android.os.Binder
@@ -122,15 +122,14 @@ constructor(

    /** Creates the task fragment */
    fun createTaskFragment() {
        val taskBounds = Rect(activity.resources.configuration.windowConfiguration.bounds)
        val fragmentOptions =
            TaskFragmentCreationParams.Builder(
                    organizer.organizerToken,
                    fragmentToken,
                    activity.activityToken!!
                )
                .setInitialRelativeBounds(taskBounds)
                .setWindowingMode(WINDOWING_MODE_MULTI_WINDOW)
                .setInitialRelativeBounds(Rect())
                .setWindowingMode(WINDOWING_MODE_FULLSCREEN)
                .build()
        organizer.applyTransaction(
            WindowContainerTransaction().createTaskFragment(fragmentOptions),