Explicitly state that "local state" is local to the window
which has started the drag operation.
Bug: 31372686
Change-Id: Idbea7586c4e74097362067fa90390b97744181bb
mWinFrame as set when returning from relayout will be in screen
space coordinates. repositionChild however expects coordinates relative to the
parent position (like relayout).
Bug: 31112993
Change-Id: Id4fcd7fcb771908e8a7db981207d19c99fb51b98
It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.
Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.
Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.
We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.
bug:30150688
Change-Id: Ia1dae626bd9e22541be46edb072aa288eb1ae414
This CL fixes typos in JavaDoc for InputConnection.
This CL slso updates the content regarding a new API that was added in
API 25 [1][2].
[1]: Iaadf934a997ffcd6000a516cc3c1873db56e60ad
152944f490
[2]: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
adebb52588
Bug: 31249896
Change-Id: Icafedb15943a84f8e5b03ef9eb3a50627d508bdd
TalkBack was speaking all Toasts twice because we were
sending both NOTIFICATION and a WINDOW_STATE_CHANGE events
when Toasts were displayed.
Stop sending the WINDOW_STATE_CHANGE event for toasts.
Bug: 30570188
Change-Id: I26c6dc50350dfd4daf2a706b94fadcf5d1e03557
Surface is parcelled partly in java, partly in native, and any fields
added in java have to be accounted for in the native side as well.
Add a warning to avoid issues in the future
Bug: 31162160
Change-Id: I48ca1bc3eea29f1ac3d3065f6defb6ed2be4052a
The following changes are in this commit:
Avoid destroying TextureView surfaces for onStop
bug:30238922
TextureViews will hold onto their backing surfaces, which will allow
them to resume gracefully when the app's surfaces are saved.
Now only resources that are destroyed for onStop are DisplayLists.
(cherry picked from commit 391d560402)
TextureView: destroy layer on destroyHardwareResources event
bug:30468770
(cherry picked from commit 1c16c37d86)
Fix NPE in TextureView
Bug: 30651595
(cherry picked from commit 3c2587f26e)
Fix NPE in TextureView
Bug: 30779663
(cherry picked from commit 7e237189c2)
Fix maps resume being blank
Bug: 30889568
Fixes an issue where mLayer didn't have
the mSurface set on it in certain resume
scenarios.
(cherry picked from commit 03df0834e6)
Before there was a jump-cut when a window that was occluding Keyguard
was going away, leading to an ugly flicker. To fix this, we do the
following.
- Always show windows with FLAG_SHOW_WHEN_LOCKED above lockscreen, even
if they don't "match" the currently occluding app (which is null in the
animation case)
- Move wallpaper behind last window that is not hidden by policy, so the
window doesn't get occluded by the wallpaper.
- Add a flag in the setOccluded call whether to animate or not. SystemUI
then plays a nice animation when it's set.
- Override the animation to always be the animation that happens when we
exit a window which is revealing the wallpaper behind, to make it
consistent with the home screen case.
Fixes: 30829255
Change-Id: Ib3fe20fc9003a0f9f291c974740f044ed8707e75
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
(cherry picked from commit dd228fbb4d)
Some apps rely on their drawables not getting not-visible hints via
setVisible when the window visibility changes. This manifests as
additional animations, such as crossfading from placeholders when the
window becomes visible again.
Apps should be able to handle this case in the future now that we have
more detailed reporting via onVisibilityAggregated, but to keep
existing apps working as-is, ImageView now operates in a compatibility
mode for targetSdkVersion < N and will only dispatch visibility
signals based on the same triggers used in M. New apps get the more
detailed signals.
Fix a bug where window visibility dispatch via onVisibilityAggregated
would double-dispatch "not visible" when the window is transitioning
from GONE => INVISIBLE or INVISIBLE => GONE.
Make the growing set of compatibility check fields in ImageView
static, matching the pattern from View.
Bug 30216207
Change-Id: I88875260bf6aaa23687c7d51353de8d633383531
Restrict saved surface to launcher start (ACTION_MAIN&CATEGORY_
LAUNCHER), or there is no intent at all (eg. task being brought to
front). If the intent is something else, likely the app is going
to show some specific page or view, instead of what's left last time.
This solves problems like the launcher shortcuts on DeckClock,
each of them is a different intent and will show one specific
view regardless of last states. Another example is Chrome tab
opened directly by action VIEW to open some URL.
(Note that this doesn't solve the problem with Chrome homescreen
shortcuts, it will still start with saved surface (if Chrome
is already open). This is because the shortcut is a trampoline
activity that starts the real chrome tab activity, but when
the trampoline is started, the whole task is already brought
to front, and ChromeTab could become visible with the task
before we actually start it.)
bug: 31055479
bug: 27747315
Change-Id: Id3e61c61ef516b0edc1f174320f02661222f226b
(cherry picked from commit ad24f96def)
This reverts commit c34649411d.
Dispatching accessibility events in their own thread is causing Chrome and gmail to crash. We've identified two issues: Chrome is allocating strings natively using references that aren't valid outside of their thread, and the text is being set to values that are changed in the UI thread.
I'm going to resolve these issues on master by making deep copies of the strings, but that change will have its own performance implications.
Since we were bit almost immediately by an unexpected result of this change, and I need to erode its benefit by making deep copies, I think it's a bad bet to push it into MR1.
Bug: 31042124
Change-Id: I6f5c225a9197036db43fd0ac6008447b22617525
Some existing apps treat drawable visibility notifications as a signal
to crossfade from a placeholder to the new image for the purposes of
scrolling onscreen via a recycling collection view or similar. Since
dispatchVisibilityAggregated is now called for window visibility
changes and ImageView informs its drawable of the visiblity change,
the extra call triggers a repeat fade-in in some existing apps when
you return them to visibility.
These apps should pay attention to the second parameter of
Drawable#setVisible, which signals that animations should not restart
in response to a visibility change. Updating to targetSdkVersion=24+
will enable the new behavior.
Bug 30216207
Change-Id: I27ce9f09bc7544863f7f7980c273650949db21cc
First, we fix the transparent region computation to use the order as the
drawing. Previously, it is using the tree traverse order, not the draw order.
Second, add the y offset for any view with positive z value, this will allow
some space for shadow.
b/30124573
Change-Id: I98d38261ffd346b762651e087cb243e45fed6952
Bug: 30889568
Fixes an issue where mLayer didn't have
the mSurface set on it in certain resume
scenarios.
Change-Id: Ib75065d3d75e6141d6cd8f306584f6a569b9907c
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
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
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