1 /* 2 * Copyright (C) 2019 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 android.platform.helpers; 18 19 public interface IAutoVehicleHardKeysHelper extends IAppHelper { 20 21 /** Enum class for volume types */ 22 enum VolumeType { 23 Media, 24 Ring, 25 Notification, 26 Navigation, 27 } 28 29 /** Enum class for driving state */ 30 enum DrivingState { 31 UNKNOWN, 32 MOVING, 33 IDLING, 34 PARKED, 35 } 36 37 /** 38 * Setup expectations: incoming call in progress. 39 * 40 * Recieve phone call 41 */ pressRecieveCallKey()42 void pressRecieveCallKey(); 43 44 /** 45 * Setup expectations: The app is open and there is an ongoing call. 46 * 47 * End call using hardkey. 48 */ pressEndCallKey()49 void pressEndCallKey(); 50 51 /** 52 * Setup expectations: The Media app is active. 53 * 54 * Change media track using hardkey. 55 */ pressMediaNextTrackKey()56 void pressMediaNextTrackKey(); 57 58 /** 59 * Setup expectations: The Media app is active. 60 * 61 * Change media track using hardkey. 62 */ pressMediaPreviousTrackKey()63 void pressMediaPreviousTrackKey(); 64 65 /** 66 * Setup expectations: The Media app is active. 67 * 68 * Increase media volume. 69 */ tuneVolumeUpKey()70 void tuneVolumeUpKey(); 71 72 /** 73 * Setup expectations: The Media app is active. 74 * 75 * Decrease media volume. 76 */ tuneVolumeDownKey()77 void tuneVolumeDownKey(); 78 79 /** Increase brightness. */ pressBrightnessUpKey()80 void pressBrightnessUpKey(); 81 82 /** Decrease brighness. */ pressBrightnessDownKey()83 void pressBrightnessDownKey(); 84 85 /** Launch assistant. */ pressAssistantKey()86 void pressAssistantKey(); 87 88 /** 89 * Setup expectations: The media app is active. 90 * 91 * Tune volume knob to mute media. 92 */ tuneMuteKey()93 void tuneMuteKey(); 94 95 /** Switch off screen. */ pressScreenOffKey()96 void pressScreenOffKey(); 97 98 /** Select content. */ tuneKnobKey()99 void tuneKnobKey(); 100 101 /** Open selected content. */ pressKnobButtonKey()102 void pressKnobButtonKey(); 103 104 /** Increase/decrease volume */ tuneVolumeKnobKey()105 void tuneVolumeKnobKey(); 106 107 /** Mute media by pressing volume knob. */ pressVolumeKnobButtonKey()108 void pressVolumeKnobButtonKey(); 109 110 /** 111 * Get current volume level for a specific type of volume. Eg: Media, In-call, Alarm, Navigation 112 * 113 * @param type type of volume to get current volume level from. 114 */ getCurrentVolumeLevel(VolumeType type)115 int getCurrentVolumeLevel(VolumeType type); 116 117 /** Get driving state. */ getDrivingState()118 DrivingState getDrivingState(); 119 120 /** 121 * Set driving state. 122 * 123 * @param state to be set. 124 */ setDrivingState(DrivingState state)125 void setDrivingState(DrivingState state); 126 127 /** 128 * Set vehicle speed. 129 * 130 * @param speed to be set. 131 */ setSpeed(int speed)132 void setSpeed(int speed); 133 } 134