1 /* 2 * Copyright (c) 2018, 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 package com.android.server.policy; 17 18 /** Used with LocalServices to add custom handling to global actions. */ 19 public interface GlobalActionsProvider { 20 /** @return {@code true} if the dialog is enabled. */ isGlobalActionsDisabled()21 boolean isGlobalActionsDisabled(); 22 /** Set the listener that will handle various global actions evetns. */ setGlobalActionsListener(GlobalActionsListener listener)23 void setGlobalActionsListener(GlobalActionsListener listener); 24 /** Show the global actions UI to the user. */ showGlobalActions()25 void showGlobalActions(); 26 27 /** Listener to pass global actions events back to system. */ 28 public interface GlobalActionsListener { 29 /** 30 * Called when sysui starts and connects its status bar, or when the status bar binder 31 * dies indicating sysui is no longer alive. 32 */ onGlobalActionsAvailableChanged(boolean available)33 void onGlobalActionsAvailableChanged(boolean available); 34 35 /** 36 * Callback from sysui to notify system that global actions has been successfully shown. 37 */ onGlobalActionsShown()38 void onGlobalActionsShown(); 39 40 /** 41 * Callback from sysui to notify system that the user has dismissed global actions and 42 * it no longer needs to be displayed (even if sysui dies). 43 */ onGlobalActionsDismissed()44 void onGlobalActionsDismissed(); 45 } 46 } 47