Fields Summary |
---|
private static final String | TAG |
private static final boolean | DEBUG |
private static final boolean | localLOGV |
private static final boolean | SHOW_STARTING_ANIMATIONS |
private static final int | APPLICATION_LAYER |
private static final int | PHONE_LAYER |
private static final int | SEARCH_BAR_LAYER |
private static final int | STATUS_BAR_PANEL_LAYER |
private static final int | TOAST_LAYER |
private static final int | STATUS_BAR_LAYER |
private static final int | PRIORITY_PHONE_LAYER |
private static final int | SYSTEM_ALERT_LAYER |
private static final int | SYSTEM_ERROR_LAYER |
private static final int | KEYGUARD_LAYER |
private static final int | KEYGUARD_DIALOG_LAYER |
private static final int | SYSTEM_OVERLAY_LAYER |
private static final int | APPLICATION_PANEL_SUBLAYER |
private static final int | APPLICATION_MEDIA_SUBLAYER |
private static final int | APPLICATION_SUB_PANEL_SUBLAYER |
private static final boolean | SINGLE_PRESS_OFF |
private static final float | SLIDE_TOUCH_EVENT_SIZE_LIMIT |
public static final String | SYSTEM_DIALOG_REASON_KEY |
public static final String | SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS |
public static final String | SYSTEM_DIALOG_REASON_RECENT_APPS |
private android.content.Context | mContext |
private android.view.IWindowManager | mWindowManager |
private android.os.LocalPowerManager | mPowerManager |
boolean | mSafeMode |
private android.view.WindowManagerPolicy.WindowState | mStatusBar |
private android.view.WindowManagerPolicy.WindowState | mSearchBar |
private android.view.WindowManagerPolicy.WindowState | mKeyguard |
private boolean | mFirstConnect |
private GlobalActions | mGlobalActions |
private boolean | mShouldTurnOffOnKeyUp |
private RecentApplicationsDialog | mRecentAppsDialog |
private android.os.Handler | mHandler |
private boolean | mLidOpen |
private boolean | mScreenOn |
private int | mCurrentAppOrientation |
private int | mW |
private int | mH |
private int | mCurLeft |
private int | mCurTop |
private int | mCurRight |
private int | mCurBottom |
static final android.graphics.Rect | mTmpParentFrame |
static final android.graphics.Rect | mTmpDisplayFrame |
static final android.graphics.Rect | mTmpVisibleFrame |
private android.view.WindowManagerPolicy.WindowState | mTopFullscreenOpaqueWindowState |
private boolean | mForceStatusBar |
private boolean | mHomePressed |
private android.content.Intent | mHomeIntent |
private boolean | mSearchKeyPressed |
private boolean | mConsumeSearchKeyUp |
private static final int | ENDCALL_HOME |
private static final int | ENDCALL_SLEEPS |
private static final int | DEFAULT_ENDCALL_BEHAVIOR |
private int | mEndcallBehavior |
private ShortcutManager | mShortcutManager |
private PowerManager.WakeLock | mBroadcastWakeLock |
private Runnable | mEndCallLongPress |
private Runnable | mHomeLongPressWhen a home-key longpress expires, close other system windows and launch the recent apps |
private static final boolean | PRINT_ANIM |
private android.content.BroadcastReceiver | mBroadcastDone |
Methods Summary |
---|
public android.view.View | addStartingWindow(android.os.IBinder appToken, java.lang.String packageName, int theme, java.lang.CharSequence nonLocalizedLabel, int labelRes, int icon){@inheritDoc}
if (!SHOW_STARTING_ANIMATIONS) {
return null;
}
if (packageName == null) {
return null;
}
Context context = mContext;
boolean setTheme = false;
//Log.i(TAG, "addStartingWindow " + packageName + ": nonLocalizedLabel="
// + nonLocalizedLabel + " theme=" + Integer.toHexString(theme));
if (theme != 0 || labelRes != 0) {
try {
context = context.createPackageContext(packageName, 0);
if (theme != 0) {
context.setTheme(theme);
setTheme = true;
}
} catch (PackageManager.NameNotFoundException e) {
}
}
if (!setTheme) {
context.setTheme(com.android.internal.R.style.Theme);
}
Window win = PolicyManager.makeNewWindow(context);
Resources r = context.getResources();
win.setTitle(r.getText(labelRes, nonLocalizedLabel));
win.setType(
WindowManager.LayoutParams.TYPE_APPLICATION_STARTING);
win.setFlags(
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE|
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE|
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
win.setLayout(WindowManager.LayoutParams.FILL_PARENT,
WindowManager.LayoutParams.FILL_PARENT);
final WindowManager.LayoutParams params = win.getAttributes();
params.token = appToken;
params.packageName = packageName;
params.windowAnimations = win.getWindowStyle().getResourceId(
com.android.internal.R.styleable.Window_windowAnimationStyle, 0);
params.setTitle("Starting " + packageName);
try {
WindowManagerImpl wm = (WindowManagerImpl)
context.getSystemService(Context.WINDOW_SERVICE);
View view = win.getDecorView();
if (win.isFloating()) {
// Whoops, there is no way to display an animation/preview
// of such a thing! After all that work... let's skip it.
// (Note that we must do this here because it is in
// getDecorView() where the theme is evaluated... maybe
// we should peek the floating attribute from the theme
// earlier.)
return null;
}
if (localLOGV) Log.v(
TAG, "Adding starting window for " + packageName
+ " / " + appToken + ": "
+ (view.getParent() != null ? view : null));
wm.addView(view, params);
// Only return the view if it was successfully added to the
// window manager... which we can tell by it having a parent.
return view.getParent() != null ? view : null;
} catch (WindowManagerImpl.BadTokenException e) {
// ignore
Log.w(TAG, appToken + " already running, starting window not displayed");
}
return null;
|
public void | adjustConfigurationLw(android.content.res.Configuration config){@inheritDoc}
mPowerManager.setKeyboardVisibility(true);
config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO;
mPowerManager.userActivity(SystemClock.uptimeMillis(), false,
LocalPowerManager.OTHER_EVENT);
|
public void | adjustWindowParamsLw(WindowManager.LayoutParams attrs)
switch (attrs.type) {
case TYPE_SYSTEM_OVERLAY:
case TYPE_TOAST:
// These types of windows can't receive input events.
attrs.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
break;
}
|
public void | animatingWindowLw(android.view.WindowManagerPolicy.WindowState win, WindowManager.LayoutParams attrs){@inheritDoc}
if (mTopFullscreenOpaqueWindowState == null
&& attrs.type >= FIRST_APPLICATION_WINDOW
&& attrs.type <= LAST_APPLICATION_WINDOW
&& win.fillsScreenLw(mW, mH, true, false)
&& win.isDisplayedLw()) {
mTopFullscreenOpaqueWindowState = win;
} else if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
mForceStatusBar = true;
}
|
public void | beginAnimationLw(int displayWidth, int displayHeight){@inheritDoc}
mTopFullscreenOpaqueWindowState = null;
mForceStatusBar = false;
|
public void | beginLayoutLw(int displayWidth, int displayHeight){@inheritDoc}
mW = displayWidth;
mH = displayHeight;
mCurLeft = 0;
mCurTop = 0;
mCurRight = displayWidth;
mCurBottom = displayHeight;
// decide where the status bar goes ahead of time
if (mStatusBar != null) {
final Rect pf = mTmpParentFrame;
final Rect df = mTmpDisplayFrame;
final Rect vf = mTmpVisibleFrame;
pf.left = df.left = vf.left = 0;
pf.top = df.top = vf.top = 0;
pf.right = df.right = vf.right = displayWidth;
pf.bottom = df.bottom = vf.bottom = displayHeight;
mStatusBar.computeFrameLw(pf, df, vf, vf);
mCurTop = mStatusBar.getFrameLw().bottom;
}
|
public int | checkAddPermission(WindowManager.LayoutParams attrs){@inheritDoc}
int type = attrs.type;
if (type < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW
|| type > WindowManager.LayoutParams.LAST_SYSTEM_WINDOW) {
return WindowManagerImpl.ADD_OKAY;
}
String permission = null;
switch (type) {
case TYPE_TOAST:
// XXX right now the app process has complete control over
// this... should introduce a token to let the system
// monitor/control what they are doing.
break;
case TYPE_PHONE:
case TYPE_PRIORITY_PHONE:
case TYPE_SYSTEM_ALERT:
case TYPE_SYSTEM_ERROR:
case TYPE_SYSTEM_OVERLAY:
permission = android.Manifest.permission.SYSTEM_ALERT_WINDOW;
break;
default:
permission = android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
}
if (permission != null) {
if (mContext.checkCallingOrSelfPermission(permission)
!= PackageManager.PERMISSION_GRANTED) {
return WindowManagerImpl.ADD_PERMISSION_DENIED;
}
}
return WindowManagerImpl.ADD_OKAY;
|
public boolean | detectSafeMode()
try {
int menuState = mWindowManager.getKeycodeState(KeyEvent.KEYCODE_MENU);
mSafeMode = menuState > 0;
Log.i(TAG, "Menu key state: " + menuState + " safeMode=" + mSafeMode);
return mSafeMode;
} catch (RemoteException e) {
// Doom! (it's also local)
throw new RuntimeException("window manager dead");
}
|
public void | enableKeyguard(boolean enabled){@inheritDoc}
|
public void | enableScreenAfterBoot(){@inheritDoc}
updateRotation();
|
public void | exitKeyguardSecurely(OnKeyguardExitResult callback){@inheritDoc}
|
public boolean | finishAnimationLw(){@inheritDoc}
if (mStatusBar != null) {
if (mForceStatusBar) {
mStatusBar.showLw(true);
} else if (mTopFullscreenOpaqueWindowState != null) {
WindowManager.LayoutParams lp =
mTopFullscreenOpaqueWindowState.getAttrs();
boolean hideStatusBar =
(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
if (hideStatusBar) {
mStatusBar.hideLw(true);
} else {
mStatusBar.showLw(true);
}
}
}
return false;
|
public boolean | finishLayoutLw(){@inheritDoc}
return false;
|
private static android.media.IAudioService | getAudioInterface()
return IAudioService.Stub.asInterface(ServiceManager.checkService(Context.AUDIO_SERVICE));
|
public void | getContentInsetHintLw(WindowManager.LayoutParams attrs, android.graphics.Rect coveredInset)
final int fl = attrs.flags;
if ((fl &
(FLAG_LAYOUT_IN_SCREEN | FLAG_FULLSCREEN | FLAG_LAYOUT_INSET_DECOR))
== (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
coveredInset.set(mCurLeft, mCurTop, mW - mCurRight, mH - mCurBottom);
} else {
coveredInset.setEmpty();
}
|
boolean | goHome()goes to the home screen
if (false) {
// This code always brings home to the front.
mContext.startActivity(mHomeIntent);
} else {
// This code brings home to the front or, if it is already
// at the front, puts the device to sleep.
try {
int result = ActivityManagerNative.getDefault()
.startActivity(null, mHomeIntent,
mHomeIntent.resolveTypeIfNeeded(mContext.getContentResolver()),
null, 0, null, null, 0, true /* onlyIfNeeded*/, false);
if (result == IActivityManager.START_RETURN_INTENT_TO_CALLER) {
return false;
}
} catch (RemoteException ex) {
// bummer, the activity manager, which is in this process, is dead
}
}
sendCloseSystemWindows();
return true;
|
public boolean | inKeyguardRestrictedKeyInputMode(){@inheritDoc}
return false;
|
public void | init(android.content.Context context, android.view.IWindowManager windowManager, android.os.LocalPowerManager powerManager){@inheritDoc}
mContext = context;
mWindowManager = windowManager;
mPowerManager = powerManager;
mHandler = new Handler();
mShortcutManager = new ShortcutManager(context, mHandler);
mShortcutManager.observe();
mHomeIntent = new Intent(Intent.ACTION_MAIN, null);
mHomeIntent.addCategory(Intent.CATEGORY_HOME);
mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mBroadcastWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"MidWindowManager.mBroadcastWakeLock");
|
public boolean | interceptKeyTi(android.view.WindowManagerPolicy.WindowState win, int code, int metaKeys, boolean down, int repeatCount){@inheritDoc}
if (false) {
Log.d(TAG, "interceptKeyTi code=" + code + " down=" + down + " repeatCount="
+ repeatCount);
}
// Clear a pending HOME longpress if the user releases Home
// TODO: This could probably be inside the next bit of logic, but that code
// turned out to be a bit fragile so I'm doing it here explicitly, for now.
if ((code == KeyEvent.KEYCODE_HOME) && !down) {
mHandler.removeCallbacks(mHomeLongPress);
}
// If the HOME button is currently being held, then we do special
// chording with it.
if (mHomePressed) {
// If we have released the home key, and didn't do anything else
// while it was pressed, then it is time to go home!
if (code == KeyEvent.KEYCODE_HOME) {
if (!down) {
mHomePressed = false;
launchHomeFromHotKey();
}
}
return true;
}
// First we always handle the home key here, so applications
// can never break it, although if keyguard is on, we do let
// it handle it, because that gives us the correct 5 second
// timeout.
if (code == KeyEvent.KEYCODE_HOME) {
// If a system window has focus, then it doesn't make sense
// right now to interact with applications.
WindowManager.LayoutParams attrs = win != null ? win.getAttrs() : null;
if (attrs != null) {
int type = attrs.type;
if (type >= WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW
&& type <= WindowManager.LayoutParams.LAST_SYSTEM_WINDOW) {
// Only do this once, so home-key-longpress doesn't close itself
if (repeatCount == 0 && down) {
sendCloseSystemWindows();
}
return false;
}
}
if (down && repeatCount == 0) {
mHandler.postDelayed(mHomeLongPress, ViewConfiguration.getGlobalActionKeyTimeout());
mHomePressed = true;
}
return true;
} else if (code == KeyEvent.KEYCODE_MENU) {
// Hijack modified menu keys for debugging features
final int chordBug = KeyEvent.META_SHIFT_ON;
final int chordProcess = KeyEvent.META_ALT_ON;
if (down && repeatCount == 0) {
if ((metaKeys & chordBug) == chordBug) {
Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
mContext.sendOrderedBroadcast(intent, null);
return true;
} else if ((metaKeys & chordProcess) == chordProcess) {
Intent service = new Intent();
service.setClassName(mContext, "com.android.server.LoadAverageService");
ContentResolver res = mContext.getContentResolver();
boolean shown = Settings.System.getInt(
res, Settings.System.SHOW_PROCESSES, 0) != 0;
if (!shown) {
mContext.startService(service);
} else {
mContext.stopService(service);
}
Settings.System.putInt(
res, Settings.System.SHOW_PROCESSES, shown ? 0 : 1);
return true;
}
}
} else if (code == KeyEvent.KEYCODE_NOTIFICATION) {
if (down) {
// this key doesn't exist on current hardware, but if a device
// didn't have a touchscreen, it would want one of these to open
// the status bar.
IStatusBar sbs = IStatusBar.Stub.asInterface(ServiceManager.getService("statusbar"));
if (sbs != null) {
try {
sbs.toggle();
} catch (RemoteException e) {
// we're screwed anyway, since it's in this process
throw new RuntimeException(e);
}
}
}
return true;
} else if (code == KeyEvent.KEYCODE_SEARCH) {
if (down) {
if (repeatCount == 0) {
mSearchKeyPressed = true;
}
} else {
mSearchKeyPressed = false;
if (mConsumeSearchKeyUp) {
// Consume the up-event
mConsumeSearchKeyUp = false;
return true;
}
}
}
// Shortcuts are invoked through Search+key, so intercept those here
if (mSearchKeyPressed) {
if (down && repeatCount == 0) {
Intent shortcutIntent = mShortcutManager.getIntent(code, metaKeys);
if (shortcutIntent != null) {
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(shortcutIntent);
/*
* We launched an app, so the up-event of the search key
* should be consumed
*/
mConsumeSearchKeyUp = true;
return true;
}
}
}
return false;
|
public int | interceptKeyTq(android.view.RawInputEvent event, boolean screenIsOn){@inheritDoc}
int result = ACTION_PASS_TO_USER | ACTION_POKE_USER_ACTIVITY;
return result;
|
public boolean | isAppSwitchKeyTqTiLwLi(int keycode){@inheritDoc}
return keycode == KeyEvent.KEYCODE_HOME
|| keycode == KeyEvent.KEYCODE_ENDCALL;
|
public boolean | isCheekPressedAgainstScreen(android.view.MotionEvent ev)
return false;
|
private boolean | isDeviceProvisioned()
return Settings.System.getInt(
mContext.getContentResolver(), Settings.System.DEVICE_PROVISIONED, 0) != 0;
|
public boolean | isMovementKeyTi(int keycode){@inheritDoc}
switch (keycode) {
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
return true;
}
return false;
|
private boolean | isMusicActive()
final IAudioService audio = getAudioInterface();
if (audio == null) {
Log.w(TAG, "isMusicActive: couldn't get IAudioService reference");
return false;
}
try {
return audio.isMusicActive();
} catch (RemoteException e) {
Log.w(TAG, "IAudioService.isMusicActive() threw RemoteException " + e);
return false;
}
|
public boolean | isWakeAbsMovementTq(int device, int classes, android.view.RawInputEvent event){@inheritDoc}
// if it's tagged with one of the wake bits, it wakes up the device
return ((event.flags & (FLAG_WAKE | FLAG_WAKE_DROPPED)) != 0);
|
protected boolean | isWakeKeyTq(android.view.RawInputEvent event)Given the current state of the world, should this key wake up the device?
// There are not key maps for trackball devices, but we'd still
// like to have pressing it wake the device up, so force it here.
int keycode = event.keycode;
int flags = event.flags;
if (keycode == RawInputEvent.BTN_MOUSE) {
flags |= WindowManagerPolicy.FLAG_WAKE;
}
return (flags
& (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
|
public boolean | isWakeRelMovementTq(int device, int classes, android.view.RawInputEvent event){@inheritDoc}
// if it's tagged with one of the wake bits, it wakes up the device
return ((event.flags & (FLAG_WAKE | FLAG_WAKE_DROPPED)) != 0);
|
public boolean | keyguardIsShowingTq(){@inheritDoc}
return false;
|
private void | launchHomeFromHotKey()A home key -> launch home action was detected. Take the appropriate action
given the situation with the keyguard.
// no keyguard stuff to worry about, just launch home!
mContext.startActivity(mHomeIntent);
sendCloseSystemWindows();
|
public void | layoutWindowLw(android.view.WindowManagerPolicy.WindowState win, WindowManager.LayoutParams attrs, android.view.WindowManagerPolicy.WindowState attached){@inheritDoc}
// we've already done the status bar
if (win == mStatusBar) {
return;
}
final int fl = attrs.flags;
final Rect pf = mTmpParentFrame;
final Rect df = mTmpDisplayFrame;
final Rect vf = mTmpVisibleFrame;
if ((fl &
(FLAG_LAYOUT_IN_SCREEN | FLAG_FULLSCREEN | FLAG_LAYOUT_INSET_DECOR))
== (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
df.left = 0;
df.top = 0;
df.right = mW;
df.bottom = mH;
vf.left = mCurLeft;
vf.top = mCurTop;
vf.right = mCurRight;
vf.bottom = mCurBottom;
} else if ((fl & FLAG_LAYOUT_IN_SCREEN) == 0) {
// Make sure this window doesn't intrude into the status bar.
df.left = vf.left = mCurLeft;
df.top = vf.top = mCurTop;
df.right = vf.right = mCurRight;
df.bottom = vf.bottom = mCurBottom;
} else {
df.left = vf.left = 0;
df.top = vf.top = 0;
df.right = vf.right = mW;
df.bottom = vf.bottom = mH;
}
if (attached != null && (fl & (FLAG_LAYOUT_IN_SCREEN)) == 0) {
pf.set(attached.getFrameLw());
} else {
pf.set(df);
}
if ((fl & FLAG_LAYOUT_NO_LIMITS) != 0) {
df.left = df.top = vf.left = vf.top = -10000;
df.right = df.bottom = vf.right = vf.bottom = 10000;
}
win.computeFrameLw(pf, df, vf, vf);
|
public void | onKeyguardShow()Callback from {@link KeyguardViewMediator}
sendCloseSystemWindows();
|
public boolean | performHapticFeedbackLw(android.view.WindowManagerPolicy.WindowState win, int effectId, boolean always)
return false;
|
public int | prepareAddWindowLw(android.view.WindowManagerPolicy.WindowState win, WindowManager.LayoutParams attrs)Preflight adding a window to the system.
Currently enforces that three window types are singletons:
- STATUS_BAR_TYPE
- SEARCH_BAR_TYPE
- KEYGUARD_TYPE
switch (attrs.type) {
case TYPE_STATUS_BAR:
if (mStatusBar != null) {
return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
}
mStatusBar = win;
break;
case TYPE_SEARCH_BAR:
if (mSearchBar != null) {
return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
}
mSearchBar = win;
break;
case TYPE_KEYGUARD:
if (mKeyguard != null) {
return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
}
mKeyguard = win;
break;
}
return WindowManagerImpl.ADD_OKAY;
|
public boolean | preprocessInputEventTq(android.view.RawInputEvent event){@inheritDoc}
return false;
|
public void | removeStartingWindow(android.os.IBinder appToken, android.view.View window){@inheritDoc}
// RuntimeException e = new RuntimeException();
// Log.i(TAG, "remove " + appToken + " " + window, e);
if (localLOGV) Log.v(
TAG, "Removing starting window for " + appToken + ": " + window);
if (window != null) {
WindowManagerImpl wm = (WindowManagerImpl) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.removeView(window);
}
|
public void | removeWindowLw(android.view.WindowManagerPolicy.WindowState win){@inheritDoc}
if (mStatusBar == win) {
mStatusBar = null;
}
else if (mSearchBar == win) {
mSearchBar = null;
}
else if (mKeyguard == win) {
mKeyguard = null;
}
|
public int | rotationForOrientationLw(int orientation, int lastRotation, boolean displayEnabled)
// get rid of rotation for now. Always rotation of 0
return Surface.ROTATION_0;
|
public void | screenOnStoppedLw()
|
public void | screenTurnedOff(int why){@inheritDoc}
EventLog.writeEvent(70000, 0);
mScreenOn = false;
|
public void | screenTurnedOn(){@inheritDoc}
EventLog.writeEvent(70000, 1);
mScreenOn = true;
|
public int | selectAnimationLw(android.view.WindowManagerPolicy.WindowState win, int transit){@inheritDoc}
if (PRINT_ANIM) Log.i(TAG, "selectAnimation in " + win
+ ": transit=" + transit);
if (transit == TRANSIT_PREVIEW_DONE) {
if (win.hasAppShownWindows()) {
if (PRINT_ANIM) Log.i(TAG, "**** STARTING EXIT");
return com.android.internal.R.anim.app_starting_exit;
}
}
return 0;
|
private void | sendCloseSystemWindows()
sendCloseSystemWindows(null);
|
private void | sendCloseSystemWindows(java.lang.String reason)
Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
if (reason != null) {
intent.putExtra(SYSTEM_DIALOG_REASON_KEY, reason);
}
mContext.sendBroadcast(intent);
|
private void | sendVolToMusic(int keycode)Tell the audio service to adjust the volume appropriate to the event.
final IAudioService audio = getAudioInterface();
if (audio == null) {
Log.w(TAG, "sendVolToMusic: couldn't get IAudioService reference");
return;
}
try {
// since audio is playing, we shouldn't have to hold a wake lock
// during the call, but we do it as a precaution for the rare possibility
// that the music stops right before we call this
mBroadcastWakeLock.acquire();
audio.adjustStreamVolume(
AudioManager.STREAM_MUSIC,
keycode == KeyEvent.KEYCODE_VOLUME_UP
? AudioManager.ADJUST_RAISE
: AudioManager.ADJUST_LOWER,
0);
} catch (RemoteException e) {
Log.w(TAG, "IAudioService.adjustStreamVolume() threw RemoteException " + e);
} finally {
mBroadcastWakeLock.release();
}
|
public void | setCurrentOrientationLw(int newOrientation)
if(newOrientation != mCurrentAppOrientation) {
mCurrentAppOrientation = newOrientation;
}
|
private void | showGlobalActionsDialog()
if (mGlobalActions == null) {
mGlobalActions = new GlobalActions(mContext, mPowerManager);
}
mGlobalActions.showDialog(false, isDeviceProvisioned());
|
private void | showRecentAppsDialog()Create (if necessary) and launch the recent apps dialog
if (mRecentAppsDialog == null) {
mRecentAppsDialog = new RecentApplicationsDialog(mContext);
}
mRecentAppsDialog.show();
|
public int | subWindowTypeToLayerLw(int type){@inheritDoc}
switch (type) {
case TYPE_APPLICATION_PANEL:
return APPLICATION_PANEL_SUBLAYER;
case TYPE_APPLICATION_MEDIA:
return APPLICATION_MEDIA_SUBLAYER;
case TYPE_APPLICATION_SUB_PANEL:
return APPLICATION_SUB_PANEL_SUBLAYER;
}
Log.e(TAG, "Unknown sub-window type: " + type);
return 0;
|
public void | systemReady(){@inheritDoc}
try {
if (mSafeMode) {
// If the user is holding the menu key code, then we are
// going to boot into safe mode.
ActivityManagerNative.getDefault().enterSafeMode();
} else {
// tell the keyguard
android.os.SystemProperties.set("dev.bootcomplete", "1");
}
} catch (RemoteException e) {
}
|
private void | updateRotation()
mPowerManager.setKeyboardVisibility(true);
int rotation = Surface.ROTATION_0;
try {
//set orientation on WindowManager
mWindowManager.setRotation(rotation, true, 0);
} catch (RemoteException e) {
}
mPowerManager.userActivity(SystemClock.uptimeMillis(), false,
LocalPowerManager.OTHER_EVENT);
|
public int | windowTypeToLayerLw(int type){@inheritDoc}
if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
return APPLICATION_LAYER;
}
switch (type) {
case TYPE_APPLICATION_PANEL:
return APPLICATION_LAYER;
case TYPE_APPLICATION_SUB_PANEL:
return APPLICATION_LAYER;
case TYPE_STATUS_BAR:
return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
return STATUS_BAR_PANEL_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
}
Log.e(TAG, "Unknown window type: " + type);
return APPLICATION_LAYER;
|