195d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor/*
295d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor * Copyright (C) 2017 The Android Open Source Project
395d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor *
495d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
595d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor * except in compliance with the License. You may obtain a copy of the License at
695d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor *
795d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor *      http://www.apache.org/licenses/LICENSE-2.0
895d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor *
995d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor * Unless required by applicable law or agreed to in writing, software distributed under the
1095d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1195d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor * KIND, either express or implied. See the License for the specific language governing
1295d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor * permissions and limitations under the License.
1395d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor */
1495d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
1595d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorpackage com.android.systemui.plugins.statusbar;
1695d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
1795d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorimport com.android.systemui.plugins.annotations.DependsOn;
1895d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorimport com.android.systemui.plugins.annotations.ProvidesInterface;
1995d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorimport com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption;
2095d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
2195d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorimport android.service.notification.SnoozeCriterion;
2295d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorimport android.service.notification.StatusBarNotification;
2395d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorimport android.view.MotionEvent;
2495d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorimport android.view.View;
25920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellorimport android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
2695d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
2795d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor@ProvidesInterface(version = NotificationSwipeActionHelper.VERSION)
2895d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor@DependsOn(target = SnoozeOption.class)
2995d743c38c919dd500d9dcacf9f998500d403d9eMady Mellorpublic interface NotificationSwipeActionHelper {
3095d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public static final String ACTION = "com.android.systemui.action.PLUGIN_NOTIFICATION_SWIPE_ACTION";
3195d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
3295d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public static final int VERSION = 1;
3395d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
3495d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    /**
3595d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor     * Call this to dismiss a notification.
3695d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor     */
3795d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public void dismiss(View animView, float velocity);
3895d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
3995d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    /**
4095d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor     * Call this to snap a notification to provided {@code targetLeft}.
4195d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor     */
4295d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public void snap(View animView, float velocity, float targetLeft);
4395d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
4495d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    /**
4595d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor     * Call this to snooze a notification based on the provided {@link SnoozeOption}.
4695d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor     */
4795d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public void snooze(StatusBarNotification sbn, SnoozeOption snoozeOption);
4895d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
4995d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public float getMinDismissVelocity();
5095d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
5195d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public boolean isDismissGesture(MotionEvent ev);
5295d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
53bd707492a2ef3641a9e9a64ef72b3b031dac0bb6Mady Mellor    public boolean isFalseGesture(MotionEvent ev);
54bd707492a2ef3641a9e9a64ef72b3b031dac0bb6Mady Mellor
5595d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public boolean swipedFarEnough(float translation, float viewSize);
5695d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
5795d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    public boolean swipedFastEnough(float translation, float velocity);
5895d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor
5995d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    @ProvidesInterface(version = SnoozeOption.VERSION)
60920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor    public interface SnoozeOption {
61920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor        public static final int VERSION = 2;
62920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor
63920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor        public SnoozeCriterion getSnoozeCriterion();
64920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor
65920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor        public CharSequence getDescription();
66920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor
67920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor        public CharSequence getConfirmation();
68920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor
69920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor        public int getMinutesToSnoozeFor();
70920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor
71920fd89aefee6b39aa634d6bb49c0669a86a63e3Mady Mellor        public AccessibilityAction getAccessibilityAction();
7295d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor    }
7395d743c38c919dd500d9dcacf9f998500d403d9eMady Mellor}
74