diff options
| author | 2023-07-31 12:10:16 +0200 | |
|---|---|---|
| committer | 2023-07-31 15:40:46 +0200 | |
| commit | c46192200564cc4f6b8c6069d0b8c4e8b17bd356 (patch) | |
| tree | d597b65223052e2a77f5305d97d8de38f7568786 | |
| parent | 40383d7977e6e611fa619af2add08bbef7eb7e53 (diff) | |
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
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java | 2 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/PipModule.java | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java index d972f48b92fd..16c39601e0bf 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java @@ -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, diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/PipModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/PipModule.java index 2ded4a32a9f3..04032bb17fec 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/PipModule.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/PipModule.java @@ -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; + } } } |