This fixes a bug in StatusView believed to be caused by
seeing "invalid charger" update from BatteryService.
The code normally relies on "interesting events", as determined
by KeyguardUpdateMonitor. I believe something else is
triggering an update (perhaps a SimStateChanged event) that updates
the status without also updating StatusView.mShowingBatteryInfo
and mPluggedIn.
The safer way to do this is to explicitly check the battery
level before telling the user the device needs to be charged.
Change-Id: Ic39ed86c78a157dc9fbdef4d76a9c3db39ccafca
When invoking a registered shortcut for which the activity was not
found, the startActivity throws ActivityNotFoundException. If this
exception is not caught and handled, then the shortcut key is
dispatched to the application instead of being suppressed as it
should have been.
Found while fixing Bug: 3396233
Change-Id: I0e8e9e3ba09dd403a901d5eae12839734be467ed
I hadn't wanted to do this, but it makes porting the FLAG_FULLSCREEN
stuff over to this simpler because you don't have to go find a view
to proxy through.
This change also clears the flag everywhere when the window manager
notifies the views that the change has come back.
Change-Id: I48392c7550925bcca50c5bb9e1f263e99de6c7bc
The SurfaceHolder provided by the wallpaper service was not reporting
the correct size in getSurfaceFrame(). This broke an optimization in
the ImageWallpaper. The old code happened to work because calling
lockCanvas on the SurfaceHolder with a null dirty rectangle happened
to have the side-effect of updating the SurfaceHolder's surface frame
size field because it passed mSurfaceFrame as the dirty rect, causing
mSurfaceFrame to be set to the size of the region to be drawn.
However, relying on this side-effect is wrong. Among other things,
the dirty region could actually be smaller than the surface frame.
This patch fixes WallpaperService, SurfaceView and ViewRoot to ensure
that the surface frame size is always set explicitly and is not modified
by calls to lockCanvas.
Change-Id: I10948f5ec269409ceaf0f7d32b3f6731e9499ebc
The objective in this listener is to be more careful about the
signal processing to prevent spurious orientation changes
and to make all of the tweakable factors physically meaningful.
The calibration is defined in terms of time constants and
does not assume a particular discrete sampling rate. This is
useful because it allows us to change the accelerometer sampling
interval if desired without having to change the calibration.
Moreover, the accelerometer sampling interval can vary +/- 20ms
from one sample to the next even in normal circumstances.
Proposed orientation changes are weighted by confidence factors
that vary exponentially in relation to how close the device
is to the ideal orientation change posture (screen is vertical,
angle is exactly at the midpoint of the orientation quadrant,
and no external acceleration beside gravity). When not in an ideal
posture, the device takes proportionally longer to settle into a
new orientation state.
Added a little tool to plot the log output of the
WindowOrientationListener. Check the README for more information
about how to use it.
Change-Id: I787f02d03582ff26367df65eda8d9ce85c5cb343
1. Views may setSystemUiVisibility() to recommend that
the system chrome (status bar or other UI) show or hide
itself. (This functionality was previously available only
via the FLAG_FULLSCREEN window flag for some SystemUI
implementations.)
2. Views may register a OnSystemUiVisibilityChangedListener
on a view, and find out when the system UI actually
appears or disappears, allowing apps to coordinate the
appearance of their own UI if desired.
Bug: 3241144
Change-Id: Ia1758d94099182d49a1e3688ea2738ae4995b829
Fixed a bug in the handling of SENSOR_LANDSCAPE and SENSOR_PORTAIT
on devices that have a natural landscape orientation. The old code
was disabling 180 degree orientation detection when it shouldn't have.
Change-Id: I484a0aa44b3b8267a7d3b74bdf39c296faa7c6e3
This updates the lockscreen keyboard to be like the
latin-1 IME keyboard and updates it to fit the holo theme.
Fixed some minor issues addressed in review.
Change-Id: I3c6dd8f91be753510e6eadfa9ad913f77038947b
Don't dismiss by default when tapping outside, even for AlertDialog.
If AlertDialog doesn't have any buttons, tapping outside will dismiss it.
Applications can make their own dialogs (or activities looking like
dialogs) can use the existing and new APIs to control this behavior
themselves so that it does the right thing.
Change-Id: I02bfb9161e169de0033200211b3a7ec80080bd83
The phone-oriented code for turning off animations when the screen is entirely
covered by the status bar was not appropriate for the tablet.
Change-Id: Ica3e0db989f16b9187eacd6ecf4ac3d17661dd6d
Sometimes we get the wrong value for the sensor resource we
use to configure lockscreen orientation. However, the current
UI design has LockScreen always respond to orientation (when
enabled in settings) so we don't need to rely on this for the time-being.
Change-Id: If37314befd25a7b3306500643155523ad4fe6657
LockScreen wasn't correctly updating StatusView when the battery
status changed. In addition, the messages aren't supposed to
"pop" when changed, so changed visibility state from GONE to INVISIBLE
when not in use.
Change-Id: Icacbf7e2275c77a28e7e0a9d1247abdbebadcd4f
BT or USB keyboards currently cause the on-screen keyboard to
be hidden. This will probably need to be refactored in the
future but the change is too complicated for the current
release.
Change-Id: Ieb655b85622f7c174ed4a5d1c3766d130a9d32f1
This works around a bug in the framework where LockScreen wouldn't
get GC'd under certain circumstances which would lead to an OOM
crash. It now uses WeakReferences for observers inside the
DigitalClock container class and unregisters them if the containing
DigitalClock goes away.
Also removed mLive variable which was unused and could potentially
leak the receivers.
Left mAttached for debugging so we can use it to determine if the
calls to onAttachToWindow() and onDetachFromWindow() are grossly
unbalanced which may be the root cause of the original problem.
Have cleanUp() explicitly clear unused references to make
tracing through hprof references easier.
Change-Id: I99a7e0c356001b05eab5aa729564553666febfea
Also hide menu shortcuts everywhere until we can get around to
redesigning the menu UI to be more consistent.
Bug: 3306545
Bug: 3330748
Change-Id: I4d4e19525cdfc93d9aae0dcaa1e6266fb552c5bc
The title of the Phone options dialog is displayed using wrong
translation if the user changes the current language setting. Moving
the setTitle call to prepareDialog to ensure that the title gets
updated before the dialog is shown.
Change-Id: I6f8f460789effd22de5be8339cc46667269e78c0
The title of the Phone options dialog is displayed using wrong
translation if the user changes the current language setting. Moving
the setTitle call to prepareDialog to ensure that the title gets
updated before the dialog is shown.
Change-Id: I03ff59c7f4ff711a06b05de7cca94fa928cf67ef
Fixed a race condition during startup. We need to wait for the input
devices to actually be ready before trying to detect safe mode.
Fixed a problem during safe mode activation where we would try to add
the overlay window but the display was not initialized. Now we do it
after the system is ready.
Bug: 3134825
Change-Id: I4c043c142ae6bf0d865c79d266d36154eaf00709
The problem is that if a window containing children is removed
before the children are, the children may be lost. This change
(amongst the huge amount of new debugging code) now ensures at
this point that all children windows are removed when the parent
is.
Note that this results in a bunch of error messages now as the
client app tries to continue to do things with that child window.
This is correct, it shouldn't be doing that, and needs to be
fixed to stop it. But at least it now can't cause the window
manager to leak surfaces.
Change-Id: I7b80dd89ff9de7cb5af1dc759cfa4b31ac29cddc