Commit Graph

8305 Commits

Author SHA1 Message Date
Yohei Yukawa
6bc17c7320 Make View#isTemporarilyDetached() less confusing
am: ed841cbdd7

Change-Id: I2df97c1babb9fc515295c527a18d9f88546dfad7
2016-08-17 19:49:01 +00:00
Chong Zhang
5e09ceb641 Add new window type TYPE_DRAWN_APPLICATION
am: fea963edee

Change-Id: If7acf1349b87d4be88a9b4f9fbd984bbd4aca8ad
2016-08-17 17:16:18 +00:00
John Reck
08669fff33 Fix maps resume being blank
am: 03df0834e6

Change-Id: Iad93e1b11e74acf2356d59c271892d6741b53fef
2016-08-17 17:14:23 +00:00
John Reck
03df0834e6 Fix maps resume being blank
Bug: 30889568

Fixes an issue where mLayer didn't have
the mSurface set on it in certain resume
scenarios.

Change-Id: Ib75065d3d75e6141d6cd8f306584f6a569b9907c
2016-08-16 09:44:23 -07:00
Robert Carr
5f684d92b6 Introduce new constant for double tap gesture rotation hint.
am: 57d9fbd17f

Change-Id: I994c15c692ec52160deb3d29b46396802562588a
2016-08-16 01:35:59 +00:00
TreeHugger Robot
b14543d9d8 Merge "Introduce new constant for double tap gesture rotation hint." into nyc-mr1-dev 2016-08-16 01:21:57 +00:00
Chong Zhang
fea963edee Add new window type TYPE_DRAWN_APPLICATION
This type behaves like a normal TYPE_APPLICATION, except that WM
will always wait for it to be drawn before starting a transition.

WM always waits for TYPE_BASE_APPLICATION (main window), but for
TYPE_APPLICATION, it only waits if the window relayouts to visible
and gets a surface before the main window is drawn. If main window
itself is ready very fast, transition could start without the other
window.

bug: 30830849
Change-Id: Ife71a9812db7c8eba6ee4ead10ce4f31d9e93b40
2016-08-15 17:36:40 -07:00
Robert Carr
57d9fbd17f Introduce new constant for double tap gesture rotation hint.
As discussed in ag/1192965/ we have a special case for rotation
animation selection in launch from double tap. This was set to
ROTATION_ANIMATION_CROSSFADE as the goal was just to avoid
ROTATION_ANIMATION_ROTATE on the viewfinder surface and
seamless rotation in launch scenarios was initially descoped. Now we
are aiming at fixing this though, and ROTATION_ANIMATION_CROSSFADE
does not quality for seamless rotation. ROTATION_ANIMATION_JUMPCUT
also would not be a good choice because in the situation that the
rotation occurs before the app starting window appears, then we would
jump cut from unrotated wallpaper to rotated app, I think we want
a crossfade in this scenario. To this end introduce and use a new @hide constant
ROTATION_ANIMATION_SEAMLESS which qualifies for seamless but falls back
to CROSSFADE if seamless can't occur.

Bug: 30171992
Change-Id: If1945b17b5159be4cd5ba0b139d6bea9f7fcca33
2016-08-15 12:25:37 -07:00
Hui Shu
440d84f99a Fix documentation.
am: bd042e666a

Change-Id: Ib749bd51c24a2012cd2b0d87ed70c034f410bc58
2016-08-12 21:29:47 +00:00
Hui Shu
caef4afe42 Merge "Fix documentation." into nyc-mr1-dev 2016-08-12 21:24:44 +00:00
Alison Cichowlas
091fc718d4 Add restart to GlobalActions.
am: f8eca405c1

Change-Id: Ib9664d086e2ac57db905fbfa03329c1a990051fc
2016-08-12 20:18:41 +00:00
Alison Cichowlas
c7d6af6cd0 Merge "Add restart to GlobalActions." into nyc-mr1-dev 2016-08-12 20:12:38 +00:00
Agnieszka Madurska
5e933c1e43 Merge "Avoid an NPE while checking view location on screen." into cw-f-dev 2016-08-12 18:08:25 +00:00
Alison Cichowlas
f8eca405c1 Add restart to GlobalActions.
Update power icon in GlobalActions for consistency
with new restart icon.

Bug: 30395806
Change-Id: I5ab20c15c889384fb685fc678fbf9ed912fcde5d
2016-08-12 13:41:00 -04:00
Aga Madurska
a56454645f Avoid an NPE while checking view location on screen.
Bug:30483148

Change-Id: I115da4fefff5fecc04135e2b150e1e77445cb86e
2016-08-12 18:00:25 +01:00
John Reck
ed1f1399d4 Fix NPE in TextureView
am: 7e237189c2

Change-Id: I16d37e5c8ab6b81b57f510be5cdea09047cdbd79
2016-08-12 14:31:49 +00:00
Hui Shu
bd042e666a Fix documentation.
Remove spurious duplicate line in JavaDoc.

Change-Id: I7ee7339d2ef21241ff21e66683e37e8ea0bbfaa4
2016-08-12 00:27:39 +00:00
Yohei Yukawa
ed841cbdd7 Make View#isTemporarilyDetached() less confusing
In Android N, View#isTemporarilyDetached() returns true if it is called
when the same View instance is handling View#onFinishTemporaryDetach().

Returning true there is, however, sometimes confusing, especially
scenarios like the following case:

    @Override
    public void onFinishTemporaryDetach() {
        doSomeRestoringWorks();
    }

    private void doSomeRestoringWorks() {
        doSomething();
    }

    private doSomething() {
        if (isTemporarilyDetached()) {
            // As of N, we hit here if this is called as a result of
            // View#onFinishTemporaryDetach().
        } else {
            // but is the logic here is more likely to be appropriate
            // when handling View#onFinishTemporaryDetach()?
        }
    }

What this CL aims to do is to let View#isTemporarilyDetached() return
false when it is called while handling View#onFinishTemporaryDetach(),
because it should make View#onFinishTemporaryDetach() more useful.

Regarding the app compatibility, View#isTemporarilyDetached() was added
in API 24 hence the impact on this change is still limited.

Bug: 30791718
Change-Id: If384da9f9e6ff849598896901626fd021bae5cda
2016-08-11 11:00:23 -07:00
John Reck
7e237189c2 Fix NPE in TextureView
Bug: 30779663
Change-Id: Ib3d40b60674ab3de8bfcfdd8489b89cf07b8d8b3
2016-08-11 10:43:14 -07:00
John Reck
9dd91dec3f Make updateSurface non-blocking
am: cd68212f08

Change-Id: I691e5a2979e92572440ad7c410e8f0cec6169beb
2016-08-10 17:33:06 +00:00
John Reck
8d521bb9b3 Merge "Make updateSurface non-blocking" into nyc-mr1-dev 2016-08-10 17:22:48 +00:00
Dianne Hackborn
3a585b86be Fix issue #30766518: Document what targeting N does
am: b34cbedb4e

Change-Id: I2d2c45ef1dc9528b2b84778532edebac8a9e7712
2016-08-10 00:57:54 +00:00
Dianne Hackborn
75cdd5f68f Merge "Fix issue #30766518: Document what targeting N does" into nyc-mr1-dev 2016-08-10 00:45:55 +00:00
Dianne Hackborn
b34cbedb4e Fix issue #30766518: Document what targeting N does
Also small documentation cleanup in a few other places.

Change-Id: I16581c751aa0ffa146faba3b140a8fa2170f4520
2016-08-09 13:21:24 -07:00
John Reck
cd68212f08 Make updateSurface non-blocking
Bug: 30442298

We already do this for initialize(), fix
it so that update() is parallel with the
UI thread as well.

Shaves ~7ms off of the 99th percentile on
NotificationShade open & close

Change-Id: I1791df495453fb9e1e12362c68e3d20e837e62be
2016-08-09 12:11:13 -07:00
John Reck
936166fd5b Fix currentAnimationTimeMillis to use vsync time
am: a2acb4f077

Change-Id: Id70516e3444441ed16afbf658e8a446333eb32ff
2016-08-08 22:04:48 +00:00
John Reck
8bcd5bc5b0 Merge "Fix currentAnimationTimeMillis to use vsync time" into nyc-mr1-dev 2016-08-08 21:49:04 +00:00
Muyuan Li
4e6d496674 Prevents screenshot layer from dismissing IME.
am: 36ca72c6c2

Change-Id: I0eb890d51edf58ac4e18d26af5331429a305c4f2
2016-08-08 17:54:57 +00:00
Muyuan Li
36ca72c6c2 Prevents screenshot layer from dismissing IME.
Add code to adjustWindowLw to force the flag
FLAG_NOT_FOCUSABLE to be set for layer type
TYPE_SCREENSHOT.

Bug: 30485483
Change-Id: I11725eb89fda59b6d50fa1700845cdfe9ffb930b
2016-08-06 20:49:51 -07:00
Yohei Yukawa
9f3e418f92 Make sure IME focus is synced to View focus
am: dd228fbb4d

Change-Id: Ic1bd5be0bb52dc4692ef5dedce90d0b71c1ab013
2016-08-06 18:26:19 +00:00
Yohei Yukawa
dd228fbb4d Make sure IME focus is synced to View focus
This CL fixes an edge case that my previous CL [1] forgot to handle.

The goal of my previous CL was to avoid InputMethodManager from getting
confused by a false focus-in event from temporarily detached Views.
However, my CL forgot to take care of the case where the temporarily
detached View is still focused even after the temporary detach mode is
done.

The bad news is that such a situation is relatively easy to trigger by
having a ListView that has EditText as follows, which seems to be
known to be a common technique in Android developer community to put an
EditText in a ListView.
  ListView#listView.addHeaderView(new EditText(context), null, true);

If the ListView is initialized as above, and the EditText has input
focus, View focus and IME focus start to disagree immediatelly after the
ListView's layout is re-evaluated.  This is really easy to trigger, for
example just by dismissing the IME window.

In summary, the root cause is that InputMethodManager#focusIn(View) is
now always ignored as long as the View is temporarily detached, under an
assumption that IMM#focusIn(View) will be called back again with a View
that is not temporarily detached when everything is stable.  Hence the
fix is to do so by hooking up View#dispatchFinishTemporaryDetach() to
call IMM#focusIn(View) again when the View is actually focused in the
final state.

 [1]: Ia79bbd8468f768d546354382b47b39dd31ef7bb5
      a4ed0cfcb6

Bug: 30022872
Bug: 30578745
Bug: 30706985
Change-Id: Iecbdb00dcef8c72e4f7b31035c9bf0f4a40a578f
2016-08-05 15:38:55 -07:00
Adrian Roos
cb5642afae Keyguard: Refactoring for improving trusted unlock while occluded
am: d88eb2693b

Change-Id: I91f6bfe7a0573ad31785c5a3d1bff03a24d1107c
2016-08-05 18:45:41 +00:00
Adrian Roos
c49dfaf4d6 Merge changes from topic 'smooth_unlock' into nyc-mr1-dev
* changes:
  Keyguard: Improve trusted unlock while occluded
  Keyguard: Refactoring for improving trusted unlock while occluded
2016-08-05 18:37:29 +00:00
John Reck
a2acb4f077 Fix currentAnimationTimeMillis to use vsync time
Bug: 30674719
Change-Id: I71f51eea971e43cbe85bb0713a1c457a1b3243b3
2016-08-05 09:16:06 -07:00
Anthony Hugh
bfacf7ce2e Merge "Add panic detection to back button" into cw-f-dev 2016-08-05 00:47:08 +00:00
Adrian Roos
d88eb2693b Keyguard: Refactoring for improving trusted unlock while occluded
- Adds a trusted signal from Keyguard to PhoneWindowManager
- Allows PhoneWindowManager to exempt DISMISS_KEYGUARD windows from force hiding
- Allows PhoneWindowManager to dismiss Keyguard while occluded

Bug: 27410215
Change-Id: I3ad490b64a5805b6f3888a9f37fcfbdd0116395e
2016-08-05 00:04:07 +00:00
John Reck
8fe31ec0e0 Fix NPE in TextureView
am: 3c2587f26e

Change-Id: I79f35e5029cb3abb5fa74a60e448cd09835e2112
2016-08-04 16:43:29 +00:00
John Reck
3c2587f26e Fix NPE in TextureView
Bug: 30651595
Change-Id: Ic6cc2a1598de173aaadb4061562236a563a662b3
2016-08-04 07:55:38 -07:00
Anthony Hugh
96e9cc5700 Add panic detection to back button
Adds "panic" detection to the back button.  Implemented solution
uses 4x button presses in a short duration to detect for "panic".
The value used to determine the duration between key up and key down
that still count as a multi-button press is configurable via the
Settings Provider.

BUG: 28027764

Change-Id: Ibf1370ff3cb539a9a54002a8704922744a3ca5d7
2016-08-03 15:24:58 -07:00
sergeyv
ab7b865ef6 TextureView: destroy layer on destroyHardwareResources event
am: 1c16c37d86

Change-Id: I75a9c06c81f696b8a65d128f4ec20ca9d3083a07
2016-08-03 22:08:13 +00:00
Sergei Vasilinetc
ba3d4f6ea1 Merge "TextureView: destroy layer on destroyHardwareResources event" into nyc-mr1-dev 2016-08-03 21:54:10 +00:00
sergeyv
1c16c37d86 TextureView: destroy layer on destroyHardwareResources event
bug:30468770
Change-Id: I5174808e3fa6e4a87e3522246522c4e6d7ee2c3c
2016-08-02 15:40:27 -07:00
Yigit Boyar
6efd207022 Target API check for margin params fix
am: 2dd20a61e9

Change-Id: I745d44946585e08143e76b7d9da1a7302b4d66b9
2016-08-02 20:50:52 +00:00
Yigit Boyar
828d4ff61d Merge "Target API check for margin params fix" into nyc-mr1-dev 2016-08-02 20:41:08 +00:00
Yigit Boyar
2dd20a61e9 Target API check for margin params fix
Prior to N, our widgets were not converting MarginLayoutParams
properly between ViewGroups. The fix intrudced some issues in
older apps as the broken conversion code would hide developer
errors. This CL guards the change with a target API check so
that we don't affect older apps.

Bug: 30378230
Change-Id: I215281d261b553c3b4cedcd29ea0a861df809471
2016-08-02 11:27:18 -07:00
John Reck
6e30f4c789 Fix FrameMetricsObserver crash
am: 65ddb154c7

Change-Id: I48a04e9ba2674da351d227ba7f6d6069fd3e4727
2016-08-02 18:15:39 +00:00
TreeHugger Robot
0d8f164cde Merge "Fix FrameMetricsObserver crash" into nyc-mr1-dev 2016-08-02 18:06:08 +00:00
Phil Weaver
2dd6ce7aff Reduce extra a11y events when alpha changes.
am: 9937f81ac6

Change-Id: I23a097e1de51449b7dfa4a4986255fec4c8c3b05
2016-08-02 17:10:03 +00:00
Phil Weaver
41e185e73b Merge "Reduce extra a11y events when alpha changes." into nyc-mr1-dev 2016-08-02 16:54:43 +00:00
John Reck
65ddb154c7 Fix FrameMetricsObserver crash
Bug: 30587465

Someday maybe the technology will exist to
allow sharing a simple constant between
Java and C++, but today is not that day.

Change-Id: I17694746cb8712058133cd5ea10c47b9909f740b
2016-08-02 09:38:26 -07:00