auto import from //branches/cupcake/...@132569

This commit is contained in:
The Android Open Source Project
2009-02-20 07:38:32 -08:00
parent ffe2ab43f8
commit e1e5e408a4
5 changed files with 41 additions and 29 deletions

View File

@@ -167,6 +167,7 @@ public abstract class KeyguardViewBase extends FrameLayout {
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
switch (keyCode) {
case KeyEvent.KEYCODE_MUTE:
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_PLAYPAUSE:
case KeyEvent.KEYCODE_STOP:

View File

@@ -100,10 +100,9 @@ public class KeyguardViewManager implements KeyguardWindowController {
mKeyguardHost = new KeyguardViewHost(mContext, mCallback);
final int stretch = ViewGroup.LayoutParams.FILL_PARENT;
int flags = WindowManager.LayoutParams.FLAG_DITHER
int flags = WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN
/*| WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR*/
| WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN;
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR*/ ;
if (!mNeedsInput) {
flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
}

View File

@@ -641,6 +641,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
case KeyEvent.KEYCODE_MUTE:
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_PLAYPAUSE:
case KeyEvent.KEYCODE_STOP:

View File

@@ -1163,12 +1163,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
return true;
}
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_PLAYPAUSE:
case KeyEvent.KEYCODE_STOP:
case KeyEvent.KEYCODE_NEXTSONG:
case KeyEvent.KEYCODE_PREVIOUSSONG:
case KeyEvent.KEYCODE_REWIND:
case KeyEvent.KEYCODE_MUTE:
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_PLAYPAUSE:
case KeyEvent.KEYCODE_STOP:
case KeyEvent.KEYCODE_NEXTSONG:
case KeyEvent.KEYCODE_PREVIOUSSONG:
case KeyEvent.KEYCODE_REWIND:
case KeyEvent.KEYCODE_FORWARD: {
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, null);
intent.putExtra(Intent.EXTRA_KEY_EVENT, event);

View File

@@ -344,6 +344,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
* screen turning on and current app has nosensor based orientation, do nothing
*/
void updateOrientationListener() {
if (!mOrientationListener.canDetectOrientation()) {
// If sensor is turned off or nonexistent for some reason
return;
}
//Could have been invoked due to screen turning on or off or
//change of the currently visible window's orientation
if(localLOGV) Log.i(TAG, "Screen status="+mScreenOn+
@@ -1206,15 +1210,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
public void animatingWindowLw(WindowState win,
WindowManager.LayoutParams attrs) {
if (mTopFullscreenOpaqueWindowState == null
&& attrs.type >= FIRST_APPLICATION_WINDOW
&& attrs.type <= LAST_APPLICATION_WINDOW
&& win.fillsScreenLw(mW, mH, true)
&& win.isVisibleLw()) {
mTopFullscreenOpaqueWindowState = win;
} else if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0
&& win.isVisibleLw()) {
mForceStatusBar = true;
if (win.isVisibleLw()) {
if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
mForceStatusBar = true;
} else if (mTopFullscreenOpaqueWindowState == null
&& attrs.type >= FIRST_APPLICATION_WINDOW
&& attrs.type <= LAST_APPLICATION_WINDOW
&& win.fillsScreenLw(mW, mH, true, false)
&& win.isVisibleLw()) {
mTopFullscreenOpaqueWindowState = win;
}
}
}
@@ -1222,21 +1227,26 @@ public class PhoneWindowManager implements WindowManagerPolicy {
public boolean finishAnimationLw() {
boolean changed = false;
if (mStatusBar != null) {
//Log.i(TAG, "force=" + mForceStatusBar
// + " top=" + mTopFullscreenOpaqueWindowState);
if (mForceStatusBar) {
changed |= mStatusBar.showLw(true);
} else if (mTopFullscreenOpaqueWindowState != null) {
WindowManager.LayoutParams lp =
mTopFullscreenOpaqueWindowState.getAttrs();
boolean hideStatusBar =
(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
if (hideStatusBar) {
changed |= mStatusBar.hideLw(true);
} else {
changed |= mStatusBar.showLw(true);
}
}
//Log.i(TAG, "frame: " + mTopFullscreenOpaqueWindowState.getFrameLw()
// + " shown frame: " + mTopFullscreenOpaqueWindowState.getShownFrameLw());
//Log.i(TAG, "attr: " + mTopFullscreenOpaqueWindowState.getAttrs());
WindowManager.LayoutParams lp =
mTopFullscreenOpaqueWindowState.getAttrs();
boolean hideStatusBar =
(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
if (hideStatusBar) {
changed |= mStatusBar.hideLw(true);
} else {
changed |= mStatusBar.showLw(true);
}
}
}
return changed;
return changed;
}
/** {@inheritDoc} */