Loading packages/SystemUI/src/com/android/systemui/dagger/ReferenceSysUIComponent.java +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.dagger; import com.android.systemui.keyguard.KeyguardQuickAffordanceProvider; import com.android.systemui.statusbar.NotificationInsetsModule; import com.android.systemui.statusbar.QsFrameTranslateModule; import dagger.Subcomponent; Loading @@ -28,6 +29,7 @@ import dagger.Subcomponent; @Subcomponent(modules = { DefaultComponentBinder.class, DependencyProvider.class, NotificationInsetsModule.class, QsFrameTranslateModule.class, SystemUIBinder.class, SystemUIModule.class, Loading packages/SystemUI/src/com/android/systemui/dagger/SysUIComponent.java +2 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.KeyguardSliceProvider; import com.android.systemui.media.muteawait.MediaMuteAwaitConnectionCli; import com.android.systemui.media.nearby.NearbyMediaDevicesManager; import com.android.systemui.people.PeopleProvider; import com.android.systemui.statusbar.NotificationInsetsModule; import com.android.systemui.statusbar.QsFrameTranslateModule; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.unfold.FoldStateLogger; Loading Loading @@ -65,6 +66,7 @@ import dagger.Subcomponent; @Subcomponent(modules = { DefaultComponentBinder.class, DependencyProvider.class, NotificationInsetsModule.class, QsFrameTranslateModule.class, SystemUIBinder.class, SystemUIModule.class, Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowView.java +23 −6 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG; import android.annotation.ColorInt; import android.annotation.DrawableRes; import android.annotation.LayoutRes; import android.annotation.Nullable; import android.content.Context; import android.content.res.Configuration; import android.content.res.TypedArray; Loading @@ -36,6 +37,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Trace; import android.util.AttributeSet; import android.util.Pair; import android.view.ActionMode; import android.view.DisplayCutout; import android.view.InputQueue; Loading Loading @@ -74,6 +76,7 @@ public class NotificationShadeWindowView extends FrameLayout { private ViewTreeObserver.OnPreDrawListener mFloatingToolbarPreDrawListener; private InteractionEventHandler mInteractionEventHandler; private LayoutInsetsController mLayoutInsetProvider; public NotificationShadeWindowView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -108,12 +111,10 @@ public class NotificationShadeWindowView extends FrameLayout { mLeftInset = 0; mRightInset = 0; DisplayCutout displayCutout = getRootWindowInsets().getDisplayCutout(); if (displayCutout != null) { mLeftInset = displayCutout.getSafeInsetLeft(); mRightInset = displayCutout.getSafeInsetRight(); } mLeftInset = Math.max(insets.left, mLeftInset); mRightInset = Math.max(insets.right, mRightInset); Pair<Integer, Integer> pairInsets = mLayoutInsetProvider .getinsets(windowInsets, displayCutout); mLeftInset = pairInsets.first; mRightInset = pairInsets.second; applyMargins(); return windowInsets; } Loading Loading @@ -172,6 +173,10 @@ public class NotificationShadeWindowView extends FrameLayout { mInteractionEventHandler = listener; } protected void setLayoutInsetsController(LayoutInsetsController provider) { mLayoutInsetProvider = provider; } @Override public boolean dispatchTouchEvent(MotionEvent ev) { Boolean result = mInteractionEventHandler.handleDispatchTouchEvent(ev); Loading Loading @@ -353,6 +358,18 @@ public class NotificationShadeWindowView extends FrameLayout { } } /** * Controller responsible for calculating insets for the shade window. */ public interface LayoutInsetsController { /** * Update the insets and calculate them accordingly. */ Pair<Integer, Integer> getinsets(@Nullable WindowInsets windowInsets, @Nullable DisplayCutout displayCutout); } interface InteractionEventHandler { /** * Returns a result for {@link ViewGroup#dispatchTouchEvent(MotionEvent)} or null to defer Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.systemui.keyguard.ui.binder.KeyguardBouncerViewBinder; import com.android.systemui.keyguard.ui.viewmodel.KeyguardBouncerViewModel; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.NotificationInsetsController; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; Loading Loading @@ -76,6 +77,7 @@ public class NotificationShadeWindowViewController { private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; private final AmbientState mAmbientState; private final PulsingGestureListener mPulsingGestureListener; private final NotificationInsetsController mNotificationInsetsController; private GestureDetector mPulsingWakeupGestureHandler; private View mBrightnessMirror; Loading Loading @@ -111,6 +113,7 @@ public class NotificationShadeWindowViewController { CentralSurfaces centralSurfaces, NotificationShadeWindowController controller, KeyguardUnlockAnimationController keyguardUnlockAnimationController, NotificationInsetsController notificationInsetsController, AmbientState ambientState, PulsingGestureListener pulsingGestureListener, FeatureFlags featureFlags, Loading @@ -134,6 +137,7 @@ public class NotificationShadeWindowViewController { mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mAmbientState = ambientState; mPulsingGestureListener = pulsingGestureListener; mNotificationInsetsController = notificationInsetsController; // This view is not part of the newly inflated expanded status bar. mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container); Loading Loading @@ -165,6 +169,7 @@ public class NotificationShadeWindowViewController { mPulsingWakeupGestureHandler = new GestureDetector(mView.getContext(), mPulsingGestureListener); mView.setLayoutInsetsController(mNotificationInsetsController); mView.setInteractionEventHandler(new NotificationShadeWindowView.InteractionEventHandler() { @Override public Boolean handleDispatchTouchEvent(MotionEvent ev) { Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationInsetsController.java 0 → 100644 +26 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import com.android.systemui.shade.NotificationShadeWindowView; /** * Calculates insets for the notification shade window view. */ public abstract class NotificationInsetsController implements NotificationShadeWindowView.LayoutInsetsController { } Loading
packages/SystemUI/src/com/android/systemui/dagger/ReferenceSysUIComponent.java +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.dagger; import com.android.systemui.keyguard.KeyguardQuickAffordanceProvider; import com.android.systemui.statusbar.NotificationInsetsModule; import com.android.systemui.statusbar.QsFrameTranslateModule; import dagger.Subcomponent; Loading @@ -28,6 +29,7 @@ import dagger.Subcomponent; @Subcomponent(modules = { DefaultComponentBinder.class, DependencyProvider.class, NotificationInsetsModule.class, QsFrameTranslateModule.class, SystemUIBinder.class, SystemUIModule.class, Loading
packages/SystemUI/src/com/android/systemui/dagger/SysUIComponent.java +2 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.KeyguardSliceProvider; import com.android.systemui.media.muteawait.MediaMuteAwaitConnectionCli; import com.android.systemui.media.nearby.NearbyMediaDevicesManager; import com.android.systemui.people.PeopleProvider; import com.android.systemui.statusbar.NotificationInsetsModule; import com.android.systemui.statusbar.QsFrameTranslateModule; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.unfold.FoldStateLogger; Loading Loading @@ -65,6 +66,7 @@ import dagger.Subcomponent; @Subcomponent(modules = { DefaultComponentBinder.class, DependencyProvider.class, NotificationInsetsModule.class, QsFrameTranslateModule.class, SystemUIBinder.class, SystemUIModule.class, Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowView.java +23 −6 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG; import android.annotation.ColorInt; import android.annotation.DrawableRes; import android.annotation.LayoutRes; import android.annotation.Nullable; import android.content.Context; import android.content.res.Configuration; import android.content.res.TypedArray; Loading @@ -36,6 +37,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Trace; import android.util.AttributeSet; import android.util.Pair; import android.view.ActionMode; import android.view.DisplayCutout; import android.view.InputQueue; Loading Loading @@ -74,6 +76,7 @@ public class NotificationShadeWindowView extends FrameLayout { private ViewTreeObserver.OnPreDrawListener mFloatingToolbarPreDrawListener; private InteractionEventHandler mInteractionEventHandler; private LayoutInsetsController mLayoutInsetProvider; public NotificationShadeWindowView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -108,12 +111,10 @@ public class NotificationShadeWindowView extends FrameLayout { mLeftInset = 0; mRightInset = 0; DisplayCutout displayCutout = getRootWindowInsets().getDisplayCutout(); if (displayCutout != null) { mLeftInset = displayCutout.getSafeInsetLeft(); mRightInset = displayCutout.getSafeInsetRight(); } mLeftInset = Math.max(insets.left, mLeftInset); mRightInset = Math.max(insets.right, mRightInset); Pair<Integer, Integer> pairInsets = mLayoutInsetProvider .getinsets(windowInsets, displayCutout); mLeftInset = pairInsets.first; mRightInset = pairInsets.second; applyMargins(); return windowInsets; } Loading Loading @@ -172,6 +173,10 @@ public class NotificationShadeWindowView extends FrameLayout { mInteractionEventHandler = listener; } protected void setLayoutInsetsController(LayoutInsetsController provider) { mLayoutInsetProvider = provider; } @Override public boolean dispatchTouchEvent(MotionEvent ev) { Boolean result = mInteractionEventHandler.handleDispatchTouchEvent(ev); Loading Loading @@ -353,6 +358,18 @@ public class NotificationShadeWindowView extends FrameLayout { } } /** * Controller responsible for calculating insets for the shade window. */ public interface LayoutInsetsController { /** * Update the insets and calculate them accordingly. */ Pair<Integer, Integer> getinsets(@Nullable WindowInsets windowInsets, @Nullable DisplayCutout displayCutout); } interface InteractionEventHandler { /** * Returns a result for {@link ViewGroup#dispatchTouchEvent(MotionEvent)} or null to defer Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.systemui.keyguard.ui.binder.KeyguardBouncerViewBinder; import com.android.systemui.keyguard.ui.viewmodel.KeyguardBouncerViewModel; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.NotificationInsetsController; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; Loading Loading @@ -76,6 +77,7 @@ public class NotificationShadeWindowViewController { private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; private final AmbientState mAmbientState; private final PulsingGestureListener mPulsingGestureListener; private final NotificationInsetsController mNotificationInsetsController; private GestureDetector mPulsingWakeupGestureHandler; private View mBrightnessMirror; Loading Loading @@ -111,6 +113,7 @@ public class NotificationShadeWindowViewController { CentralSurfaces centralSurfaces, NotificationShadeWindowController controller, KeyguardUnlockAnimationController keyguardUnlockAnimationController, NotificationInsetsController notificationInsetsController, AmbientState ambientState, PulsingGestureListener pulsingGestureListener, FeatureFlags featureFlags, Loading @@ -134,6 +137,7 @@ public class NotificationShadeWindowViewController { mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mAmbientState = ambientState; mPulsingGestureListener = pulsingGestureListener; mNotificationInsetsController = notificationInsetsController; // This view is not part of the newly inflated expanded status bar. mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container); Loading Loading @@ -165,6 +169,7 @@ public class NotificationShadeWindowViewController { mPulsingWakeupGestureHandler = new GestureDetector(mView.getContext(), mPulsingGestureListener); mView.setLayoutInsetsController(mNotificationInsetsController); mView.setInteractionEventHandler(new NotificationShadeWindowView.InteractionEventHandler() { @Override public Boolean handleDispatchTouchEvent(MotionEvent ev) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationInsetsController.java 0 → 100644 +26 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import com.android.systemui.shade.NotificationShadeWindowView; /** * Calculates insets for the notification shade window view. */ public abstract class NotificationInsetsController implements NotificationShadeWindowView.LayoutInsetsController { }