1259 Commits

Author SHA1 Message Date
Jim Miller
82f9196318 Fix 5608959: Make keyguard follow user setting for orientation
This fixes a bug where keyguard would always change orientation
when enabled from config_enableLockScreenRotation.  Now it follows
the user preference.

Change-Id: I0437d11e1984d22cdadddc57deb47d800fb86aa1
2012-07-24 14:27:12 -07:00
Dianne Hackborn
9e608c1218 Merge "Fix issue #6381224: Initial emulator boot fails and shows a blank black screen." into jb-dev 2012-06-25 17:35:49 -07:00
Dianne Hackborn
42e620caf0 Fix issue #6381224: Initial emulator boot fails and shows a blank black screen.
Make sure that all cases where we remove an activity from the history
stack, we call resumeTopActivityLocked() to cause the home activity
to be launched if the stack is now empty.

Also fixed a problem where some timeouts would not be removed when destroying
an activity, and a race condition in boot that would cause the
PhoneWindowManager to initially start out with the home key not working.

Bug: 6381224
Change-Id: If046bb01aed624b0d9ee3bbaaba68ed6b98fd1d0
2012-06-25 14:27:41 -07:00
Dianne Hackborn
357d99c61d DO NOT MERGE Fix issue #6697105: App launching sometimes has random pauses
In the course of the window manager refactoring into a separate
layout state, we introduced a bad interaction between the two
sides of the world.  This resulting in multiple hops needed between
the two sides after an application has said it is finished drawing
its window, until the window/app transition is actually started.
Especially since these hops require going through the anim side
which is vsynced (so will delay its operation until the next frame),
this could introduce a notable delay until the window is first shown.

Fix this by re-arranging the code to make one straight path from
when a window reports it is shown to us starting the app transition
that is waiting for it.  This change also includes various improvements
to debugging code that was done while working on it.

Change-Id: I7883674052da1a58df89cd1d9b8d754843cdd3db
2012-06-22 12:50:50 -07:00
Craig Mautner
4f5d1511b9 Make sure onScreenTurnedOn is called at power on.
KeyguardViewMediator.onScreenTurnedOn is not called if the device is
booted into the power-on state. In this case mScreenOn remains false
and the lockscreen will always appear after outgoing calls. This fix
ensures that onScreenTurnedOn is called when the device is powered
up in the on state.

Fixes bug 6709173.

Change-Id: I7557d8f002307b9125bc53b13bc3cb4c5c9b2758
2012-06-21 13:03:41 -07:00
Dianne Hackborn
0fa4d30b03 Merge "Fix issue #6686339: 2 taps required to launch notification..." into jb-dev 2012-06-20 12:06:38 -07:00
Dianne Hackborn
6e2281d44c Fix issue #6686339: 2 taps required to launch notification...
...or settings from lock screen

When a window is drawn, the code to determine whether it should now
be shown was calling WindowState.isReadyForDisplay().  Part of the
condition of this function is that it is not ready if a policy is
forcing the window to be hidden -- which is the case when the lock
screen is shown.  As a result, we wouldn't show the window at that
point, so wouldn't tell the activity manager that the token's windows
are visibible, and wouldn't tell the lock screen to go away.

This adds a new variation WindowState.isReadyForDisplayIgnoringKeyguard(),
which is the same as the original method but ignores the policy visibility
for app windows.  This allows windows to be go through the complete
path of handling when the window is finally drawn and telling the
activity manager about it, even if behind the lock screen.  By making it
a separate function, we don't impact any other code that is calling the
old function and may be relying on its behavior.

Also cleaned up a little of the dumpsys output.  Most important, the
new ANR section is now moved to the top, since we want
"adb shell dumpsys window" to still give a nice summary of what we
normally care about -- the window stack and important global state.

Change-Id: Ica3ea85ce46f3f5f5cd2cc30fbd9de13d3885a57
2012-06-19 17:54:24 -07:00
Jim Miller
45308b1b3b Fix 6667238: allow market apps to support ACTION_ASSIST
This change allows market apps and 3rd parties to supply an activity
that responds to ACTION_ASSIST (e.g. market apps).

It also adds a test app to respond to the ASSIST intent and force
the intent disambiguation dialog to appear.

Change-Id: I5a78863c6a9546d18c66275187d178f6a1c9ee17
2012-06-19 15:00:13 -07:00
Jean-Michel Trivi
2f4423043f Merge "Remote volume handling" into jb-dev 2012-06-19 10:54:32 -07:00
Jean-Michel Trivi
3114ce3861 Remote volume handling
Extend RemoteControlClient class to enable an applicaton to
 specify more information about how it's playing media, now covering
 usecases where media playback happens "remotely". This playback
 information can be used to set the volume and maximum volume
 used remotely.
Declare a new intent and associated extras in Intent,
 ACTION_VOLUME_UPDATE, so an application can be notified that
 the volume it handles should be updated. It can then use
 the new RemoteControlClient.setPlaybackInformation() method
 to notify AudioService what the volume is.
Extend AudioService to maintain playback information associated
 with the RemoteControlClient information in the stack of
 media button event receivers (mRCStack). The information
 about the active remote is cached so the stack doesn't have
 to be iterated over in order to retrieve remote playback info.
 Events to "adjust" the remote volume based on hardware key
 presses cause the client application to be notified of
 volume updates, and the volume panel to display the volume
 set by the app.
 Revise which stream type is controlled when none is specified
 according to latest guidelines for remote playback.
Update VolumePanel class to support a new pseudo stream type,
 AudioService.STREAM_REMOTE_MUSIC, that corresponds to the
 remote playback volume, and uses the new "media route" icon.
 Enable it to receive asynchronously new volume values for
 the remote that will be displayed if the UI is still up,
 and ignored otherwise.
 Now supports hiding/showing sliders dynamically so remote
 volume only appears when AudioService has a remote control
 client handling remote volume.
Define new java symbols for the two media route icons.
Modify lockscreen behavior: don't automatically control music
 volume when music is active, consider also remote playback.

Still to do:
- playback information set by RemoteControlClient should post
  a message for AudioService to update playback information
  instead of updating it synchronously

Change-Id: I557aa687239f9acfe33a609f05876c67fa7eb967
2012-06-18 18:37:17 -07:00
Jim Miller
12da2c5eee Merge "Fix 6665117: ACTION_ASSIST visual improvements" into jb-dev 2012-06-18 13:29:49 -07:00
Jeff Brown
d7a04de167 Capture window manager's last ANR state in bug report.
Currently just grabbing the window state but we could grab
other things as part of the last ANR report.

Bug: 6680398
Change-Id: I23aa70907b1bdcb21c8acc556fde196ca790ef6a
2012-06-17 15:55:46 -07:00
Jim Miller
20039ad17b Fix 6665117: ACTION_ASSIST visual improvements
- add generic icon for search providers that don't supply one
- change alpha weighting factor for glow
- don't show ring background

Change-Id: I86c86dc2d623c25ec7b91e206fac8ad9cd60faac
2012-06-15 18:11:00 -07:00
Jim Miller
b06be57f0a Merge "Fix 6507787: fix MMI PUK unlock procedure" into jb-dev 2012-06-15 15:19:16 -07:00
Jim Miller
2de5ee8463 Fix 6507787: fix MMI PUK unlock procedure
This fixes a bug where the user uses the MMI sequence (**05*PUK*PIN1*PIN1#)
from the EmergencyDialer to unlock their phone instead of the provided interface.

The code now recognizes when UnlockMode becomes invalid because it was previously
locked because of SIM state. It then dismisses the PUK unlock screen and advances
to the home screen.

Change-Id: I8902350e6f640cd2fa0af3460c3ea1a39d926c8a
2012-06-14 22:22:50 -07:00
Craig Mautner
f03e4c55fc Expose apps when keyguard animating.
Continuing in the trend of not hiding apps while the keyguard is
animating.

Fixes bug 6653600.

Change-Id: I151315084a13dcec061d2d6edccd31e1133610f4
2012-06-14 14:11:27 -07:00
Jeff Brown
9e197141f8 Merge "Add new ASSIST key and map it to the global assist intent." into jb-dev 2012-06-14 11:28:52 -07:00
Jeff Brown
de7a8ead24 Add new ASSIST key and map it to the global assist intent.
Moved some duplicate code from SearchPanelView and LockScreen
over to SearchManager to avoid creating yet another copy of it
in PhoneWindowManager.

Bug: 6594275
Change-Id: Ib4ebcd6817639d17548952ab2ce7cb876c05777c
2012-06-14 04:16:26 -07:00
Jeff Brown
b44700f27d Merge "When SIM absent, keyguard should be considered non-secure." into jb-dev 2012-06-14 02:45:35 -07:00
Jeff Brown
47cd14d9bc When SIM absent, keyguard should be considered non-secure.
Previously, it was observed that while a SIM is being initialized
by the hardware the SIM may briefly be reported as being in an
ABSENT state before eventually transitioning into a READY,
PIN_REQUIRED, PUK_REQUIRED, PERM_DISABLE state.

While booting up, the phone might observe that the SIM is ABSENT and
therefore bypass the keyguard going straight to the home screen.
Later when the SIM was fully initialized, the phone would revert back
to the lock screen in order to ask for the PIN.  The user might
turn on the phone, slide out the keyboard (bypassing the keyguard),
then a few moments later the keyguard would pop up prompting for a PIN.

The user experience could be somewhat jarring, so the keyguard was
changed to handle the transient case differently.  While the SIM
was ABSENT, the keyguard would not be automatically bypassed
by opening the keyboard slider.  Thus the user would be forced to
manually swipe away the keyguard before interacting with the
device.  This would help to cover the time it would take before
the SIM was fully initialized and the keyguard could determine
whether the user would need to be prompted for a SIM PIN or PUK.

To prevent the keyguard from being bypassed automatically, we
hacked up the keyguard so that it would be considered to be in a
secure state while the SIM was ABSENT.  It's worth noting that
considering the keyguard to be secure did not confer any
additional security properties to the system whatsoever.
If the user did not have a pattern lock, PIN or password set then
all it would take to access the phone is to swipe away the keyguard.

This old hack was all about devices with slide-out keyboards,
but it had some side-effects.  Namely, it assumed that the SIM
ABSENT state was transient.  But what about phones that are
being used without a SIM at all?

Considering the keyguard to be secure when the SIM is ABSENT
breaks stuff.  In fact, it turns out that making the keyguard
secure isn't really what we want at all.  What we want is a way
to prevent the keyguard from being automatically bypassed on
boot when the user opens up a sliding keyboard.  But we don't
have those anymore... and in the worst case it was just a little
janky... and what's more, nowadays the keyguard provides useful
features so maybe we shouldn't bypass it anyhow... oh and actually,
I deleted the code that used to bypass the keyguard when the
keyboard slider was opened... so this does nothing useful at all.

Right...

This change removes the old hack thereby ensuring that non-secure
keyguard features like launching the Camera or Assistant or
application features like hands-free voice search will work
correctly on phones without a SIM.

Bug: 6022658
Change-Id: I019d1d8c65c55cbf4d10d4928e1d2b2b242162a6
2012-06-13 20:00:49 -07:00
Uriel Rodriguez
aa24906de2 BUG 5457035: lowering max FUL failed attempts to 3
After an unrecognized face occurs 3 times in a row, we disable FUL until the user unlocks via the
backup lock.  Lowering this values makes spoofing with liveliness enabled more difficult.  Since
we currently don't differentiate between the max number attempts with and without liveliness
enabled, we had to lower it for all uses of FUL.

Change-Id: I7a429f64cde2767ddd2ceb0885343acd0b802aac
2012-06-13 17:30:13 -04:00
Jim Miller
955a016922 Fix 6613962: Update keyguard to use new GlowPadView UX design.
Change-Id: I4f1ef3107e5550f7df9dcb412943a84b66432b7d
2012-06-12 19:16:08 -07:00
Brian Colonna
7019325e18 Bug 6605167: Turning off FUL during error counts as attempt
If FUL was turned off while the error message was displayed it would
not count as a failed attempt.  This commit changes the
reportFailedAttempt callback to just report the failure rather than
report the failure and close.  This allows the FUL service to send the
reportFailedAttempt message earlier and then later close using the
existing cancel function, which closes without reporting a failed
attempt.

Change-Id: Ib3b76f477a98b149fcccc32ac39ecaeccd88a7e2
2012-06-08 11:50:53 -04:00
Jean-Michel Trivi
6a5f9f6ddb Merge "Configuration for lock and UI sound levels" into jb-dev 2012-06-07 15:28:51 -07:00
Jeff Brown
207673cdbb Implement new rotation policy.
Rotation lock does not override NOSENSOR mode anymore.

Centralize the rotation policy settings into a new class shared by
the System UI and Settings applications.

Add a new setting to specify whether rotation-lock is being hidden
because the "auto-rotate screen" option has been toggled in the
Accessibility settings panel.

Bug: 6523269
Change-Id: I15173280d25bc5d101e89a9c65913aefc53fc33a
2012-06-05 17:59:46 -07:00
Jean-Michel Trivi
c55b393efd Configuration for lock and UI sound levels
Define two integers in the platform configuration to
 define the sound level for lock/unlock sounds, and
 UI sound effects.
Use the corresponding value in KeyguardViewMediator for the lock sounds.
Use the corresponding value in AudioService when playing sound effects.

Bug 6448481

Change-Id: Ie238f5eb1645e395412864d93447ac4049f7e54b
2012-06-05 16:58:20 -07:00
Jim Miller
3294b6b09b Fix 6592932: add means to replace assist icon from given package
This provides the means to replace the assist icon shown in keyguard and the
navigation gesture for assist.  It's done by adding metadata called
"com.android.systemui.action_assist_icon" to the activity that handles
android.intent.action.ASSIST.  It should point to a StateListDrawable
in that package with the required states.  For example:

<meta-data android:name="com.android.systemui.action_assist_icon"
    android:resource="@drawable/ic_android_systemui_action_assist" />

And then something like this in drawable/ic_android_systemui_action_assist.xml :

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="true"
        android:state_active="false"
        android:state_focused="false"
        android:drawable="@drawable/ic_action_assist_normal" />
    <item android:state_enabled="true"
        android:state_active="true"
        android:state_focused="false"
        android:drawable="@drawable/ic_action_assist_activated" />
    <item android:state_enabled="true"
        android:state_active="false"
        android:state_focused="true"
        android:drawable="@drawable/ic_action_assist_focused" />
</selector>

Change-Id: Ibc29360e179fed68253ff06a07b1bb2b982d0dab
2012-06-01 14:08:28 -07:00
Uriel Rodriguez
fa716c7b9b Merge "BUG 5457035 : Anti-spoofing : DO NOT MERGE" into jb-dev 2012-05-31 08:44:15 -07:00
Daniel Sandler
b30cd0a801 NavBar: Don't resize in portrait docks when HDMI connected.
The computation moving the navbar up is too drastic when a device locked
in a portrait dock is connected to a landscape external display (e.g. a TV).
Instead, only do this if the aspect ratios of the device and external display
are the same.

Bug: 6513219
Change-Id: I7cfb1096b7d1a774032d22c4b0d7eb3177766c58
2012-05-31 10:48:53 -04:00
Uriel Rodriguez
4fa995a932 BUG 5457035 : Anti-spoofing : DO NOT MERGE
Squashed commit of the following:

commit c0969669a6bd55df805665c17e088456c1672da3
Author: Danielle Millett <dmillett@google.com>
Date:   Wed May 30 15:41:22 2012 -0400

    Turning liveliness back on

    As part of the change of putting in the new head turn option, it's
    now passing in the correct value to Face Unlock instead of forcing it
    to always be false.

    Change-Id: I745da5431cbc2d447f3d07ec7215c5b1850f6d57

Change-Id: I36a819b43e89a463bb3bb3ede0db36477fd45066
2012-05-30 20:01:38 -04:00
Michael Jurka
a66c75a87e Merge "Fix bug where recents was getting preloaded unnecessarily" into jb-dev 2012-05-29 12:26:35 -07:00
Amith Yamasani
3dac02265e Merge "Show power menu on tablets." into jb-dev 2012-05-29 11:22:32 -07:00
Michael Jurka
4004033f87 Fix bug where recents was getting preloaded unnecessarily
Change-Id: I7d2254da009113f81fae0a785583b1c7fd6ad020
2012-05-29 08:25:32 -07:00
Danielle Millett
45973d6d19 Merge "Moved setting the flag to suppress face unlock during a phone call" into jb-dev 2012-05-29 06:24:05 -07:00
Amith Yamasani
7ee994d728 Show power menu on tablets.
Bug: 6524432

Show power menu on all devices by default. Specific devices will be disabled in overlays.

Handle airplane mode changes differently when the telephony states are not reliable.
Use simple toggle for silent mode when there's no vibrator.

Change-Id: Ic5ef521eee19cd300d909250203ff204f3a1ae1e
2012-05-25 15:18:21 -07:00
Craig Mautner
3d7b7d59c8 Redraw all windows earlier in power on sequence.
Send a message to all windows to redraw before notifying
PhoneWindowManager of screen on. This minimizes the delay in
screen update that causes the keyguard clock to display the old time
before displaying the current time.

Fixes bug 6381021.

Change-Id: Ida7071e7dac2284540f101c5d004511b52133b91
2012-05-24 15:38:54 -07:00
Craig Mautner
8e4df6c1e2 Fix jank when launching apps that show wallpaper.
Do not create a StartingWindow for apps that show wallpaper.
Fix handling of obscure case where found wallpaper is hidden.

Fixes bug 6484034.

Change-Id: I07181c4aea56fa9e530df0c95d886fe8ad61ec9d
2012-05-23 16:57:23 -07:00
Jim Miller
a6f0b0ad69 Merge "Fix6398209: reveal search when home button is long-pressed" into jb-dev 2012-05-21 16:37:32 -07:00
Jim Miller
998bb76529 Fix6398209: reveal search when home button is long-pressed
This change add a feature to reveal the swipe to search interface
when the home key is pressed for longer than 50ms.  It progressively
reveals the interface.  It still requires a bit of tuning, but all
the basic parameters are in this CL.

Change-Id: I1d3a5bb7b912265eb41da68bc9313eee1af2e415
2012-05-21 13:55:44 -07:00
Danielle Millett
cafd387d7a Moved setting the flag to suppress face unlock during a phone call
Moved the check to suppress face unlock if a call is in progress from
onScreenTurnedOff() to initializeBiometricUnlockView().  onScreenTurnedOff()
is only called if the screen was turned off while on lockscreen and we
actually want to be doing this every time the screen is turned off.  Put a
check around it to only do it when the screen is off, so that for orientation
changes, or on first boot it doesn't override the current flag value.

This fixes the following 2 bugs:

Bug 6460309: When making a phone call, after the user hangs up and it goes
to lockscreen we don't want face unlock to show.  In the case where a
user makes an outgoing call and the phone goes to sleep by itself during
the phone call, when the call is ended face unlock was popping up because
it never went through onScreenTurnedOff().

There is a flag to make sure face unlock doesn't come up
immediately after booting the phone, which is done by not showing
face unlock the first time lockscreen is constructed.  But there are
a few cases where lockscreen doesn't come up immediately after boot: 1. When
the device is factory reset, it goes through the wizard instead of
lockscreen.  2. In userdebug if the lock type is set to none.
In both of these cases, if face unlock is set up, it doesn't show up on
the first time.  Setting the phone flag in initializeBiometricUnlockView
overrides the initial setting, which is what we want because if the screen
has turned off, it isn't the initial lockscreen after boot.

Change-Id: Iacafc515f2b594e12c853308c40cd48f3fb83e63
2012-05-20 20:30:31 -04:00
Jeff Brown
cf39bdf3df Add support for switching between multiple keyboard layouts.
Also show a notification when an external keyboard is connected
and does not have a keyboard layout selected yet.

Bug: 6405203
Change-Id: Id0ac6d83b3b381f8a236b2244a04c9acb203db3c
2012-05-20 14:56:22 -07:00
Adam Powell
fb5f1bc085 Log a warning when action bar view states cannot be restored.
Some apps can get into a case where the saved view hierarchy states
for action bar views are missing. Log a warning instead of crashing.

Bug 6510800

Change-Id: I95ede64ec584892e6e76ca9ab9d53e9d3689984f
2012-05-17 19:30:35 -07:00
Craig Mautner
d51a68b3d2 Merge "Eliminate deferred surface destruction." into jb-dev 2012-05-17 13:11:50 -07:00
Brian Colonna
2b9eba553e Merge "Not calling startUi() if no longer bound" into jb-dev 2012-05-17 06:02:09 -07:00
Jeff Brown
40013655de Support long-press on media keys with screen off.
Bug: 3204066
Change-Id: I3ea4b6ceb853483b9e103de62b2ef0cf48b3dff1
2012-05-16 21:39:05 -07:00
Craig Mautner
bf08af3323 Eliminate deferred surface destruction.
Removing the code that delays a surface destruction when
WindowManager.FLAG_KEEP_SURFACE_WHILE_ANIMATING is set. The lock
screen that continued to animate after destroySurfaceLocked is no
longer used and this code was causing problems.

Also mDrawState was being set to NO_SURFACE in destroySurfaceLocked
even if the surface ended up not being destroyed. Later when it was
reused the false value of mDrawState was messing things up.

The screen lock bug referenced below no longer levaes the user stuck
with a black lockscreen. However it occasionally powers back up in the
launcher screen rather than the lock screen.

Fixes bug 6485955.

Change-Id: I684104c7e7c39c161a5118aa890889fbae92e635
2012-05-16 20:07:22 -07:00
Dianne Hackborn
20c0cdbbf7 Merge "Have the stable layout take into account the window's fullscreen flag." into jb-dev 2012-05-16 19:41:09 -07:00
Brian Colonna
c266070aec Not calling startUi() if no longer bound
After the bind to the FUL service is complete, an
onServiceConnected() callback is received.  This callback is
asynchronous - bindService() does not block while we are waiting for
the service to finish binding.  Therefore, when rapidly turning the
screen on and off, it is possible to call bindService() and then call
unbindService() before the onServiceConnected() callback is received.
When onServiceConnected() is received, startUi() is called.  If the
service is no longer bound, a runtime restart occurs when calling
startUi().

Note that onServiceConnected() actually has its work done via a
handler.  The delay of calling the handler increases the possibility
of unbindService() being called before trying to call startUi().  But
since this problem still happens without using the handler,
eliminating using the handler would not solve the problem and would
just create the problems that come with performing operations on
different threads since onServiceConnected() is not called on the main
thread.

Also note that a new instance of FaceUnlock is created in
LockPatternKeyguardView with each iteration.  So, if we bind/stop/bind
before getting onServiceConnected(), the second bind happens in a new
instance of FaceUnlock and therefore does not lead to a problem when
onServiceConnected() returns as a result of the first bind.

This fixes some occurrences of bug 6409767.  However, this fixes the
problem when turned the device on and off rapidly.  It seems there
are some reports of bug 6409767 where this is not the case, so I
can't be sure this has any affect on those cases.

This change also cleans up some debugging and modifies other
debugging to try to get just the information that is useful for
tracking down the bug.

Change-Id: Ifa59107b9974acaa8a18b74b5d47e4cf3a794b8e
2012-05-16 22:11:30 -04:00
Dianne Hackborn
5b5cc4d536 Have the stable layout take into account the window's fullscreen flag.
When using stable layouts, you are typically expected to hide and
show the status bar through the system UI fullscreen flag.  This hides
both the status bar and the action bar.  The stable layout assumed
that when not hiding the status bar through the system UI flags, that
the status bar would be visible.

This change makes things a little smarter, also looking at the
window's fullscreen flag (which only hides the status bar).  If this
flag is set on the window, then the stable layout now assumes that
the status bar will never be shown.  This allows us to position the
action bar correctly in the situation where the application has set
the window to fullscreen and requested a stable layout, instead of
always leaving room for the status bar above it.

Change-Id: I757072ae99cd3741753af7210dbf51afe94d3db5
2012-05-16 17:24:11 -07:00
Michael Jurka
28e7320116 Merge "Revert "Add shortcut for voice search"" into jb-dev 2012-05-16 16:39:16 -07:00