1 /* 2 * Copyright (C) 2020 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.demomode; 18 19 import com.google.android.collect.Lists; 20 21 import java.util.ArrayList; 22 import java.util.List; 23 24 /** 25 * Interface defining what it means to implement DemoMode. A DemoMode implementation should 26 * register with DemoModeController, providing a list of commands for wish to listen. 27 * 28 * If you only need to listen to commands, but *do not* care about demo mode state changes, you 29 * can implement DemoModeCommandReceiver instead 30 */ 31 public interface DemoMode extends DemoModeCommandReceiver { 32 33 List<String> NO_COMMANDS = new ArrayList<>(); 34 35 /** Provide a set of commands to listen to, only acceptable values are the COMMAND_* keys */ demoCommands()36 default List<String> demoCommands() { 37 return NO_COMMANDS; 38 } 39 40 String ACTION_DEMO = "com.android.systemui.demo"; 41 42 String EXTRA_COMMAND = "command"; 43 44 /** Enter and exit are non-register-able; override started/finished to observe these states */ 45 String COMMAND_ENTER = "enter"; 46 String COMMAND_EXIT = "exit"; 47 48 /** Observable commands to register a listener for */ 49 String COMMAND_CLOCK = "clock"; 50 String COMMAND_BATTERY = "battery"; 51 String COMMAND_NETWORK = "network"; 52 String COMMAND_BARS = "bars"; 53 String COMMAND_STATUS = "status"; 54 String COMMAND_NOTIFICATIONS = "notifications"; 55 String COMMAND_VOLUME = "volume"; 56 String COMMAND_OPERATOR = "operator"; 57 58 /** New keys need to be added here */ 59 List<String> COMMANDS = Lists.newArrayList( 60 COMMAND_BARS, 61 COMMAND_BATTERY, 62 COMMAND_CLOCK, 63 COMMAND_NETWORK, 64 COMMAND_NOTIFICATIONS, 65 COMMAND_OPERATOR, 66 COMMAND_STATUS, 67 COMMAND_VOLUME 68 ); 69 } 70 71