1 /* 2 * Copyright (C) 2010 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.app; 18 19 /** 20 * Interface used to control special UI modes. 21 * @hide 22 */ 23 interface IUiModeManager { 24 /** 25 * Enables the car mode. Only the system can do this. 26 * @hide 27 */ enableCarMode(int flags, int priority, String callingPackage)28 void enableCarMode(int flags, int priority, String callingPackage); 29 30 /** 31 * Disables the car mode. 32 */ 33 @UnsupportedAppUsage(maxTargetSdk = 28) disableCarMode(int flags)34 void disableCarMode(int flags); 35 36 /** 37 * Disables car mode (the original version is marked unsupported app usage so cannot be changed 38 * for the time being). 39 */ disableCarModeByCallingPackage(int flags, String callingPackage)40 void disableCarModeByCallingPackage(int flags, String callingPackage); 41 42 /** 43 * Return the current running mode. 44 */ getCurrentModeType()45 int getCurrentModeType(); 46 47 /** 48 * Sets the night mode. 49 * The mode can be one of: 50 * 1 - notnight mode 51 * 2 - night mode 52 * 3 - automatic mode switching 53 */ setNightMode(int mode)54 void setNightMode(int mode); 55 56 /** 57 * Gets the currently configured night mode. Return 1 for notnight, 58 * 2 for night, and 3 for automatic mode switching. 59 */ getNightMode()60 int getNightMode(); 61 62 /** 63 * Tells if UI mode is locked or not. 64 */ isUiModeLocked()65 boolean isUiModeLocked(); 66 67 /** 68 * Tells if Night mode is locked or not. 69 */ isNightModeLocked()70 boolean isNightModeLocked(); 71 72 /** 73 * [De]Activates night mode 74 */ setNightModeActivated(boolean active)75 boolean setNightModeActivated(boolean active); 76 77 /** 78 * Returns custom start clock time 79 */ getCustomNightModeStart()80 long getCustomNightModeStart(); 81 82 /** 83 * Sets custom start clock time 84 */ setCustomNightModeStart(long time)85 void setCustomNightModeStart(long time); 86 87 /** 88 * Returns custom end clock time 89 */ getCustomNightModeEnd()90 long getCustomNightModeEnd(); 91 92 /** 93 * Sets custom end clock time 94 */ setCustomNightModeEnd(long time)95 void setCustomNightModeEnd(long time); 96 } 97