diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/phone/NavGesture.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/phone/NavGesture.java index aa2fb32f13a89..814324e63d198 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/phone/NavGesture.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/phone/NavGesture.java @@ -20,6 +20,7 @@ import android.view.View; import com.android.systemui.plugins.Plugin; import com.android.systemui.plugins.annotations.ProvidesInterface; +import java.io.PrintWriter; @ProvidesInterface(action = NavGesture.ACTION, version = NavGesture.VERSION) public interface NavGesture extends Plugin { @@ -46,6 +47,8 @@ public interface NavGesture extends Plugin { public void onNavigationButtonLongPress(View v); public default void destroy() { } + + public default void dump(PrintWriter pw) { } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java deleted file mode 100644 index 62d2099204e82..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2014 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.phone; - -import android.content.Context; -import android.graphics.Canvas; -import android.view.MotionEvent; -import android.view.View; -import com.android.systemui.SysUiServiceProvider; -import com.android.systemui.plugins.statusbar.phone.NavGesture.GestureHelper; - -/** - * TODO: Remove and replace with QuickStepController - */ -public class NavigationBarGestureHelper implements GestureHelper { - - private static final String TAG = "NavigationBarGestureHelper"; - - private NavigationBarView mNavigationBarView; - - private final QuickStepController mQuickStepController; - private final StatusBar mStatusBar; - - public NavigationBarGestureHelper(Context context) { - mStatusBar = SysUiServiceProvider.getComponent(context, StatusBar.class); - mQuickStepController = new QuickStepController(context); - } - - public void setComponents(NavigationBarView navigationBarView) { - mNavigationBarView = navigationBarView; - mQuickStepController.setComponents(mNavigationBarView); - } - - public void setBarState(boolean isVertical, boolean isRTL) { - mQuickStepController.setBarState(isVertical, isRTL); - } - - public boolean onInterceptTouchEvent(MotionEvent event) { - if (!canHandleGestures()) { - return false; - } - return mQuickStepController.onInterceptTouchEvent(event); - } - - public boolean onTouchEvent(MotionEvent event) { - if (!canHandleGestures()) { - return false; - } - return mQuickStepController.onTouchEvent(event); - } - - public void onDraw(Canvas canvas) { - mQuickStepController.onDraw(canvas); - } - - public void onLayout(boolean changed, int left, int top, int right, int bottom) { - mQuickStepController.onLayout(changed, left, top, right, bottom); - } - - public void onDarkIntensityChange(float intensity) { - mQuickStepController.onDarkIntensityChange(intensity); - } - - public void onNavigationButtonLongPress(View v) { - mQuickStepController.onNavigationButtonLongPress(v); - } - - private boolean canHandleGestures() { - return !mStatusBar.isKeyguardShowing(); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index e5c910069f824..1e997c08e84a3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -314,8 +314,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener