1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.shared.recents; 18 19 import android.graphics.Bitmap; 20 import android.graphics.Insets; 21 import android.graphics.Rect; 22 import android.os.Bundle; 23 import android.os.UserHandle; 24 import android.view.MotionEvent; 25 import com.android.internal.util.ScreenshotRequest; 26 27 import com.android.systemui.shared.recents.model.Task; 28 29 /** 30 * Temporary callbacks into SystemUI. 31 */ 32 interface ISystemUiProxy { 33 34 /** 35 * Begins screen pinning on the provided {@param taskId}. 36 */ startScreenPinning(int taskId)37 oneway void startScreenPinning(int taskId) = 1; 38 39 /** 40 * Notifies SystemUI that Overview is shown. 41 */ onOverviewShown(boolean fromHome)42 oneway void onOverviewShown(boolean fromHome) = 6; 43 44 /** 45 * Proxies motion events from the homescreen UI to the status bar. Only called when 46 * swipe down is detected on WORKSPACE. The sender guarantees the following order of events on 47 * the tracking pointer. 48 * 49 * Normal gesture: DOWN, MOVE/POINTER_DOWN/POINTER_UP)*, UP or CANCLE 50 */ 51 oneway void onStatusBarTouchEvent(in MotionEvent event) = 9; 52 53 /** 54 * Proxies the assistant gesture's progress started from navigation bar. 55 */ onAssistantProgress(float progress)56 oneway void onAssistantProgress(float progress) = 12; 57 58 /** 59 * Proxies the assistant gesture fling velocity (in pixels per millisecond) upon completion. 60 * Velocity is 0 for drag gestures. 61 */ onAssistantGestureCompletion(float velocity)62 oneway void onAssistantGestureCompletion(float velocity) = 18; 63 64 /** 65 * Start the assistant. 66 */ 67 oneway void startAssistant(in Bundle bundle) = 13; 68 69 /** 70 * Indicates that the given Assist invocation types should be handled by Launcher via 71 * OverviewProxy#onAssistantOverrideInvoked and should not be invoked by SystemUI. 72 * 73 * @param invocationTypes The invocation types that will henceforth be handled via 74 * OverviewProxy (Launcher); other invocation types should be handled by SysUI. 75 */ setAssistantOverridesRequested(in int[] invocationTypes)76 oneway void setAssistantOverridesRequested(in int[] invocationTypes) = 53; 77 78 /** 79 * Notifies that the accessibility button in the system's navigation area has been clicked 80 */ notifyAccessibilityButtonClicked(int displayId)81 oneway void notifyAccessibilityButtonClicked(int displayId) = 15; 82 83 /** 84 * Notifies that the accessibility button in the system's navigation area has been long clicked 85 */ notifyAccessibilityButtonLongClicked()86 oneway void notifyAccessibilityButtonLongClicked() = 16; 87 88 /** 89 * Ends the system screen pinning. 90 */ stopScreenPinning()91 oneway void stopScreenPinning() = 17; 92 93 /** 94 * Notifies that quickstep will switch to a new task 95 * @param rotation indicates which Surface.Rotation the gesture was started in 96 */ notifyPrioritizedRotation(int rotation)97 oneway void notifyPrioritizedRotation(int rotation) = 25; 98 99 /** 100 * Notifies to expand notification panel. 101 */ expandNotificationPanel()102 oneway void expandNotificationPanel() = 29; 103 104 /** 105 * Notifies SystemUI to invoke Back. 106 */ onBackPressed()107 oneway void onBackPressed() = 44; 108 109 /** Sets home rotation enabled. */ setHomeRotationEnabled(boolean enabled)110 oneway void setHomeRotationEnabled(boolean enabled) = 45; 111 112 /** Notifies when taskbar status updated */ notifyTaskbarStatus(boolean visible, boolean stashed)113 oneway void notifyTaskbarStatus(boolean visible, boolean stashed) = 47; 114 115 /** 116 * Notifies sysui when taskbar requests autoHide to stop auto-hiding 117 * If called to suspend, caller is also responsible for calling this method to un-suspend 118 * @param suspend should be true to stop auto-hide, false to resume normal behavior 119 */ notifyTaskbarAutohideSuspend(boolean suspend)120 oneway void notifyTaskbarAutohideSuspend(boolean suspend) = 48; 121 122 /** 123 * Notifies SystemUI to invoke IME Switcher. 124 */ onImeSwitcherPressed()125 oneway void onImeSwitcherPressed() = 49; 126 127 /** 128 * Notifies to toggle notification panel. 129 */ toggleNotificationPanel()130 oneway void toggleNotificationPanel() = 50; 131 132 /** 133 * Handle the screenshot request. 134 */ 135 oneway void takeScreenshot(in ScreenshotRequest request) = 51; 136 137 /** 138 * Dispatches trackpad status bar motion event to the notification shade. Currently these events 139 * are from the input monitor in {@link TouchInteractionService}. This is different from 140 * {@link #onStatusBarTouchEvent} above in that, this directly dispatches motion events to the 141 * notification shade, while {@link #onStatusBarTouchEvent} relies on setting the launcher 142 * window slippery to allow the frameworks to route those events after passing the initial 143 * threshold. 144 */ 145 oneway void onStatusBarTrackpadEvent(in MotionEvent event) = 52; 146 147 /** 148 * Animate the nav bar being long-pressed. 149 * 150 * @param isTouchDown {@code true} if the button is starting to be pressed ({@code false} if 151 * released or canceled) 152 * @param shrink {@code true} if the handle should shrink, {@code false} if it should grow 153 * @param durationMs how long the animation should take (for the {@code isTouchDown} case, this 154 * should be the same as the amount of time to trigger a long-press) 155 */ animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs)156 oneway void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs) = 54; 157 158 /** 159 * Set the override value for home button long press duration in ms and slop multiplier and 160 * haptic. 161 */ setOverrideHomeButtonLongPress(long duration, float slopMultiplier, boolean haptic)162 oneway void setOverrideHomeButtonLongPress(long duration, float slopMultiplier, boolean haptic) 163 = 55; 164 165 /** 166 * Notifies to toggle quick settings panel. 167 */ toggleQuickSettingsPanel()168 oneway void toggleQuickSettingsPanel() = 56; 169 170 // Next id = 57 171 } 172