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

Commit c4619220 authored by Jernej Virag's avatar Jernej Virag
Browse files

Fix @Nullability mismatch with PipTransition

Most of the codebase injecting `PipTransition` expects a non-null object. Trying
to inject a null will outright crash. Moreover, nullability mismatch breaks
sysui-studio builds which actually properly typecheck this nullability.

This CL provides legacy transition until non-null pip2.PipTransition is available.

Bug: 293844330
Test: verified the sysui-studio build now builds and runs
Change-Id: I330ad86a70ddfbf0d08bd6d2ed408d6856ca3162
parent 40383d79
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.dagger.pip;

import android.annotation.Nullable;
import android.content.Context;
import android.os.Handler;

@@ -229,7 +228,6 @@ public abstract class Pip1Module {

    @WMSingleton
    @Provides
    @Nullable
    static PipTransition providePipTransition(Context context,
            ShellInit shellInit, ShellTaskOrganizer shellTaskOrganizer, Transitions transitions,
            PipAnimationController pipAnimationController, PipBoundsAlgorithm pipBoundsAlgorithm,
+6 −3
Original line number Diff line number Diff line
@@ -36,10 +36,13 @@ import dagger.Provides;
public abstract class PipModule {
    @WMSingleton
    @Provides
    @Nullable
    static PipTransitionController providePipTransitionController(
            com.android.wm.shell.pip.PipTransition legacyPipTransition,
            com.android.wm.shell.pip2.PipTransition newPipTransition) {
        return PipUtils.isPip2ExperimentEnabled() ? newPipTransition : legacyPipTransition;
            @Nullable com.android.wm.shell.pip2.PipTransition newPipTransition) {
        if (PipUtils.isPip2ExperimentEnabled() && newPipTransition != null) {
            return newPipTransition;
        } else {
            return legacyPipTransition;
        }
    }
}