UserStartedState.java revision d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1
1/* 2 * Copyright (C) 2012 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 17package com.android.server.am; 18 19import java.io.PrintWriter; 20import java.util.ArrayList; 21 22import android.app.IStopUserCallback; 23import android.os.UserHandle; 24 25public class UserStartedState { 26 public final static int STATE_BOOTING = 0; 27 public final static int STATE_RUNNING = 1; 28 public final static int STATE_STOPPING = 2; 29 30 public final UserHandle mHandle; 31 public final ArrayList<IStopUserCallback> mStopCallbacks 32 = new ArrayList<IStopUserCallback>(); 33 34 public int mState = STATE_BOOTING; 35 public boolean switching; 36 public boolean initializing; 37 38 public UserStartedState(UserHandle handle, boolean initial) { 39 mHandle = handle; 40 } 41 42 void dump(String prefix, PrintWriter pw) { 43 pw.print(prefix); pw.print("mState="); pw.print(mState); 44 if (switching) pw.print(" SWITCHING"); 45 if (initializing) pw.print(" INITIALIZING"); 46 pw.println(); 47 } 48} 49