Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/LegacySizeSpecSource.kt +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.content.res.Resources import android.graphics.PointF import android.util.Size import com.android.wm.shell.R import com.android.wm.shell.pip.PipDisplayLayoutState class LegacySizeSpecSource( private val context: Context, Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithm.java→libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhonePipKeepClearAlgorithm.java +2 −5 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.wm.shell.pip.phone; package com.android.wm.shell.common.pip; import android.content.Context; import android.content.res.Resources; Loading @@ -24,9 +24,6 @@ import android.util.ArraySet; import android.view.Gravity; import com.android.wm.shell.R; import com.android.wm.shell.pip.PipBoundsAlgorithm; import com.android.wm.shell.pip.PipBoundsState; import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface; import java.util.Set; Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhoneSizeSpecSource.kt +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.content.res.Resources import android.os.SystemProperties import android.util.Size import com.android.wm.shell.R import com.android.wm.shell.pip.PipDisplayLayoutState import java.io.PrintWriter class PhoneSizeSpecSource( Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java→libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsAlgorithm.java +5 −6 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.wm.shell.pip; package com.android.wm.shell.common.pip; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -28,8 +28,6 @@ import android.util.Size; import android.view.Gravity; import com.android.wm.shell.R; import com.android.wm.shell.common.pip.PipUtils; import com.android.wm.shell.common.pip.SizeSpecSource; import java.io.PrintWriter; Loading Loading @@ -202,7 +200,8 @@ public class PipBoundsAlgorithm { * * @return {@code false} if the given source is too small to use for the entering animation. */ static boolean isSourceRectHintValidForEnterPip(Rect sourceRectHint, Rect destinationBounds) { public static boolean isSourceRectHintValidForEnterPip(Rect sourceRectHint, Rect destinationBounds) { return sourceRectHint != null && sourceRectHint.width() > destinationBounds.width() && sourceRectHint.height() > destinationBounds.height(); Loading @@ -224,7 +223,7 @@ public class PipBoundsAlgorithm { } /** * @return whether the given {@param aspectRatio} is valid. * @return whether the given aspectRatio is valid. */ public boolean isValidPictureInPictureAspectRatio(float aspectRatio) { return Float.compare(mMinAspectRatio, aspectRatio) <= 0 Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java→libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java +20 −7 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.wm.shell.pip; package com.android.wm.shell.common.pip; import android.annotation.IntDef; import android.annotation.NonNull; Loading @@ -36,7 +36,6 @@ import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.function.TriConsumer; import com.android.wm.shell.R; import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.pip.SizeSpecSource; import com.android.wm.shell.protolog.ShellProtoLogGroup; import java.io.PrintWriter; Loading Loading @@ -314,8 +313,11 @@ public class PipBoundsState { return mPipDisplayLayoutState.getDisplayLayout(); } /** * Clears the PiP re-entry state. */ @VisibleForTesting void clearReentryState() { public void clearReentryState() { mPipReentryState = null; } Loading Loading @@ -400,11 +402,18 @@ public class PipBoundsState { mNamedUnrestrictedKeepClearAreas.remove(name); } /** * @return restricted keep clear areas. */ @NonNull public Set<Rect> getRestrictedKeepClearAreas() { return mRestrictedKeepClearAreas; } /** * @return unrestricted keep clear areas. */ @NonNull public Set<Rect> getUnrestrictedKeepClearAreas() { if (mNamedUnrestrictedKeepClearAreas.isEmpty()) return mUnrestrictedKeepClearAreas; Loading Loading @@ -561,7 +570,11 @@ public class PipBoundsState { } } static final class PipReentryState { /** * Represents the state of pip to potentially restore upon reentry. */ @VisibleForTesting public static final class PipReentryState { private static final String TAG = PipReentryState.class.getSimpleName(); private final @Nullable Size mSize; Loading @@ -573,11 +586,11 @@ public class PipBoundsState { } @Nullable Size getSize() { public Size getSize() { return mSize; } float getSnapFraction() { public float getSnapFraction() { return mSnapFraction; } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/LegacySizeSpecSource.kt +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.content.res.Resources import android.graphics.PointF import android.util.Size import com.android.wm.shell.R import com.android.wm.shell.pip.PipDisplayLayoutState class LegacySizeSpecSource( private val context: Context, Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithm.java→libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhonePipKeepClearAlgorithm.java +2 −5 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.wm.shell.pip.phone; package com.android.wm.shell.common.pip; import android.content.Context; import android.content.res.Resources; Loading @@ -24,9 +24,6 @@ import android.util.ArraySet; import android.view.Gravity; import com.android.wm.shell.R; import com.android.wm.shell.pip.PipBoundsAlgorithm; import com.android.wm.shell.pip.PipBoundsState; import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface; import java.util.Set; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhoneSizeSpecSource.kt +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.content.res.Resources import android.os.SystemProperties import android.util.Size import com.android.wm.shell.R import com.android.wm.shell.pip.PipDisplayLayoutState import java.io.PrintWriter class PhoneSizeSpecSource( Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java→libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsAlgorithm.java +5 −6 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.wm.shell.pip; package com.android.wm.shell.common.pip; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -28,8 +28,6 @@ import android.util.Size; import android.view.Gravity; import com.android.wm.shell.R; import com.android.wm.shell.common.pip.PipUtils; import com.android.wm.shell.common.pip.SizeSpecSource; import java.io.PrintWriter; Loading Loading @@ -202,7 +200,8 @@ public class PipBoundsAlgorithm { * * @return {@code false} if the given source is too small to use for the entering animation. */ static boolean isSourceRectHintValidForEnterPip(Rect sourceRectHint, Rect destinationBounds) { public static boolean isSourceRectHintValidForEnterPip(Rect sourceRectHint, Rect destinationBounds) { return sourceRectHint != null && sourceRectHint.width() > destinationBounds.width() && sourceRectHint.height() > destinationBounds.height(); Loading @@ -224,7 +223,7 @@ public class PipBoundsAlgorithm { } /** * @return whether the given {@param aspectRatio} is valid. * @return whether the given aspectRatio is valid. */ public boolean isValidPictureInPictureAspectRatio(float aspectRatio) { return Float.compare(mMinAspectRatio, aspectRatio) <= 0 Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java→libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java +20 −7 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.wm.shell.pip; package com.android.wm.shell.common.pip; import android.annotation.IntDef; import android.annotation.NonNull; Loading @@ -36,7 +36,6 @@ import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.function.TriConsumer; import com.android.wm.shell.R; import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.pip.SizeSpecSource; import com.android.wm.shell.protolog.ShellProtoLogGroup; import java.io.PrintWriter; Loading Loading @@ -314,8 +313,11 @@ public class PipBoundsState { return mPipDisplayLayoutState.getDisplayLayout(); } /** * Clears the PiP re-entry state. */ @VisibleForTesting void clearReentryState() { public void clearReentryState() { mPipReentryState = null; } Loading Loading @@ -400,11 +402,18 @@ public class PipBoundsState { mNamedUnrestrictedKeepClearAreas.remove(name); } /** * @return restricted keep clear areas. */ @NonNull public Set<Rect> getRestrictedKeepClearAreas() { return mRestrictedKeepClearAreas; } /** * @return unrestricted keep clear areas. */ @NonNull public Set<Rect> getUnrestrictedKeepClearAreas() { if (mNamedUnrestrictedKeepClearAreas.isEmpty()) return mUnrestrictedKeepClearAreas; Loading Loading @@ -561,7 +570,11 @@ public class PipBoundsState { } } static final class PipReentryState { /** * Represents the state of pip to potentially restore upon reentry. */ @VisibleForTesting public static final class PipReentryState { private static final String TAG = PipReentryState.class.getSimpleName(); private final @Nullable Size mSize; Loading @@ -573,11 +586,11 @@ public class PipBoundsState { } @Nullable Size getSize() { public Size getSize() { return mSize; } float getSnapFraction() { public float getSnapFraction() { return mSnapFraction; } Loading