1 /* 2 * Copyright (C) 2014 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.statusbar; 18 19 /** 20 * Class to encapsulate all possible status bar states regarding Keyguard. 21 */ 22 public class StatusBarState { 23 24 /** 25 * The status bar is in the "normal", unlocked mode or the device is still locked but we're 26 * accessing camera from power button double-tap shortcut. 27 */ 28 public static final int SHADE = 0; 29 30 /** 31 * Status bar is currently the Keyguard. In single column mode, when you swipe from the top of 32 * the keyguard to expand QS immediately, it's still KEYGUARD state. 33 */ 34 public static final int KEYGUARD = 1; 35 36 /** 37 * Status bar is in the special mode, where it was transitioned from lockscreen to shade. 38 * Depending on user's security settings, dismissing the shade will either show the 39 * bouncer or go directly to unlocked {@link #SHADE} mode. 40 */ 41 public static final int SHADE_LOCKED = 2; 42 43 /** 44 * Returns the textual representation of the status bar state. 45 */ toString(int state)46 public static String toString(int state) { 47 switch (state) { 48 case SHADE: 49 return "SHADE"; 50 case SHADE_LOCKED: 51 return "SHADE_LOCKED"; 52 case KEYGUARD: 53 return "KEYGUARD"; 54 default: 55 return "UNKNOWN: " + state; 56 } 57 } 58 } 59