Commit Graph

2416 Commits

Author SHA1 Message Date
Winson
329011cf40 Removing private system ui flags from status bar flags logic. am: ab216609f1 am: b7a673ed95
am: dccfd4394e

Change-Id: Ie8bbbfb5c24957f64036e8de23d6a29e6669ea18
2016-09-21 07:07:59 +00:00
Winson
ab216609f1 Removing private system ui flags from status bar flags logic.
- Prevent third party apps from inadvertently changing internal SystemUI
  flags through a call to setSystemUiVisibility().  These flags are only
  set in the individual SystemUI components and can be updated in WMS
  directly.

Bug: 29875297
Change-Id: I5ea238c8fb16a0eccd6e993d95a912acb359cee6
2016-09-19 18:39:25 -07:00
Robert Carr
3b716249cc WindowManager RemoteSurfaceTrace infrastructure
Add "wm surface-trace" command which enables tracing of surface
commands to be switched on at runtime. Primarily intended for use
by WM CTS tests. First target in CTS will be to use show/hide
events to eliminate polling in WM tests and increase speed. Next up
looking at things like verifying various transitions and relaunch
scenarios are flicker free. Later we may want to look at a smarter
or more structured format...but it's really not much hassle to parse
the commands off a pipe so I wanted to get us started.

Test: cts-tradefed run singleCommand cts -o --module CtsWindowManagerHostTestCases --test android.server.cts.SurfaceViewMovementTests#testSurfaceMovesWithParent
Change-Id: I1ff912c405a6cb9996ee9b6e2c465d57706191ba
2016-09-19 11:19:31 -07:00
Diego Perez
76e53b5b04 Handle the case where there is no clip defined
Currently this generates a NPE.

Bug: http://b.android.com/221956
Change-Id: I54e758ea001c3ed41d3d01a09d9ed66be45233cc
2016-09-15 12:01:33 +00:00
John Reck
106253bdf2 Merge "Illegal behavior -> Exception" 2016-09-12 17:17:13 +00:00
John Reck
d94094e062 Illegal behavior -> Exception
Throw an IllegalStateException if the contract
of OnDrawListener is violated.

Change-Id: Ic86f6a0c8cd69ee7a8daa0ba135a3df76f56a213
2016-09-12 08:20:00 -07:00
Alan Viverette
dab82cc04c Change density for the correct user am: df3a7cab8f am: 55768028fd
am: 48818fa811

Change-Id: I19f5810159ed772ac8ed1e9d498f8fe0036a95d0
2016-09-08 21:27:04 +00:00
Alan Viverette
df3a7cab8f Change density for the correct user
Bug: 30839993
Change-Id: I5368accddfc4a03b8025a257b4155fcdc6197f11
2016-09-06 17:13:41 -04:00
Chong Zhang
813be138ae DO NOT MERGE -- Only use saved surface if started by launcher or moved to front
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)
2016-08-26 15:41:58 -07:00
Chong Zhang
ad24f96def Only use saved surface if started by launcher or moved to front
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:27747315

Change-Id: Id3e61c61ef516b0edc1f174320f02661222f226b
2016-08-26 09:58:19 -07:00
Evan Rosky
96057330b3 Fix build breakage caused by incomplete impl
Change-Id: I32a8e0e5cb5209133e00dbc0589bc8b87f46260b
2016-08-08 17:10:04 -07:00
Diego Perez
cf2d88a65d Merge "Remove deprecated overriden methods in CreateInfo" 2016-08-04 16:55:07 +00:00
Diego Perez
d07aa25398 Merge "Implement missing getAssignedPackageIdentifiers delegate" 2016-08-04 16:54:13 +00:00
Diego Perez
a4a100d206 Merge "ImageSwitcher -> ImageView in appcompat inflate" 2016-08-03 15:41:04 +00:00
Diego Perez
689a1093a6 Merge "Try to resolve IDs also as enums" 2016-08-03 15:34:31 +00:00
Diego Perez
5c93a942a5 Remove deprecated overriden methods in CreateInfo
Change-Id: Ie0b669b188086af2d6fef8f7b7d170dadb422bdb
2016-08-03 13:00:18 +00:00
TreeHugger Robot
391dfcfa68 Merge "Revert "Add per-user versions of set{Component,Application}EnabledSetting."" 2016-08-02 23:56:55 +00:00
Sudheer Shanka
38c67d3c0f Revert "Add per-user versions of set{Component,Application}EnabledSetting."
This reverts commit 0e6bfff6c1.

Change-Id: I4eafa9fc052e9eba9e26fd32c09b5e759fe63b00
2016-08-02 22:13:17 +00:00
Diego Perez
55656fedcd ImageSwitcher -> ImageView in appcompat inflate
Bug: http://b.android.com/215389
Change-Id: Ica5401bc1084247ac8ba7dc6482f7e4a2b8b593d
(cherry picked from commit 8ea861a609b5b03a1f80d4834183947f0603ba5e)
2016-08-02 15:42:23 +00:00
Diego Perez
9d0942a87c Implement missing getAssignedPackageIdentifiers delegate
Just leaving the implementation empty as that should avoid the crash
when calling it. The default stub was returning null and all the uses
were expecting an instance of SpareArray

Bug: http://b.android.com/211529
Change-Id: I497f823a6bfb7a6a946ba20c4f31b1020d2a0cef
(cherry picked from commit 98b704a284870b52cec37bf19370432c194e0608)
2016-08-02 15:41:44 +00:00
Diego Perez
f627cbb15b Try to resolve IDs also as enums
This is intended to cover the edge case in ConstraintLayout (and
possibly in other places) where an attribute is defined as
reference|enum.
If we can not resolve the value as a reference, try to resolve it as an
enum and return the value.

Change-Id: I2817aa5d78500247a2e9aec5411586a1db13791d
(cherry picked from commit b24b563654bf7c007f0912bf32fbab948fcb6daa)
2016-08-01 10:12:45 +00:00
Colin Cross
5abb99e206 Fix build
addAppToekn and setAppTask have a new argument.

Change-Id: I8a66863ba4e1cb2991a9f2ae355d0b89e9789f57
2016-07-29 10:46:58 -07:00
Diego Perez
3a6cdb18d1 Silence errors when probing for AppCompat views
Currently, the only way that layoutlib has to detect if the support
library is a dependency of the project is to try to instantiate one of
the classes. In some cases, this might report errors that we do not want
the user to see since we will fall back to loading the non-appcompat
version.

Bug: http://b.android.com/218478
Change-Id: I064209f2c31d00c0cdfc9edb4cddec40e8e8f416
(cherry picked from commit 71dcc03353d4412231c8d8d0398ccdcad6c225d1)
2016-07-28 18:36:09 +00:00
Chad Brubaker
c7d6470f75 Add missing sendBroadcastAsUser to BridgeContext
Change-Id: I843c4a97e07c955d5f588448ec1c147f4634117f
2016-07-26 14:28:56 -07:00
Chong Zhang
b2f4641039 Clean up surfaces when app is resumed without being stopped. am: 45e6d2dc8b
am: b76adc5117

Change-Id: I35c39c4fc49a953262b5b6ab4cbc2dca2ddf0b8f
2016-07-22 17:26:15 +00:00
Chong Zhang
45e6d2dc8b Clean up surfaces when app is resumed without being stopped.
When quickly toggling between two apps, app could be resumed while
it's stopping but not yet stopped. Upon resuming, it could have
surfaces that's marked mDestroying and waiting for the stopped
to be destroyed.

We need to dispose these surfaces properly. If the window is already
removed, we destroy them. Otherwise, clear mDestroying flag so that
the window is ready to be used again. Leaving mDestroying=true makes
the window ineligible for certain things such as receiving wallpaper.

bug: 30255354
Change-Id: Id881653550595ab8e702d6950949bf202ac5a0d9
2016-07-21 10:17:39 -07:00
TreeHugger Robot
c5837520ba Merge "Add per-user versions of set{Component,Application}EnabledSetting." 2016-07-20 18:58:56 +00:00
Sudheer Shanka
0e6bfff6c1 Add per-user versions of set{Component,Application}EnabledSetting.
Change-Id: Id63b233308e92a4c360f38d4728c519ac2131ff0
Fixes: 30230444
2016-07-20 10:30:57 -07:00
Diego Perez
554881712c Merge "Ignore ?attr/windowActionBar when displaying menus" 2016-07-20 12:32:49 +00:00
Diego Perez
9c142c0e15 Merge "More fixes for VectorDrawable memory management" 2016-07-20 12:32:44 +00:00
Diego Perez
c7c3636c2f Ignore ?attr/windowActionBar when displaying menus
When we are displaying menus we do not care about that theme setting as
we always want to display the actionbar and the menu.

Bug: http://b.android.com/212320
Change-Id: I3b6200cc42e3c525a3763d14d423ee8371acc2f1
(cherry picked from commit 71eb800c0bb21b0e4cea3b29235ac4e544e765b2)
2016-07-19 15:46:54 +00:00
Diego Perez
34e0121962 Restore getAccessibleMethod in the preferences inflater
It turns out that although the method was public, the class is package
protected and hence the "Accessible" call

Change-Id: Iec69ad15db4c22d472a941dd335b6cf7789eea09
(cherry picked from commit ff78c344e63c8665ab7b0773b91e473b4fe650ff)
2016-07-19 15:43:25 +00:00
Diego Perez
79b070d36b More fixes for VectorDrawable memory management
Make the release of all the VGroups deterministic once the root group
has been freed by a finalize call.
Also, free and clear the children array.

Disable assert in DelegateManager that would slow down layoutlib when
there are many delegates and assertions are enabled (dev and canary
builds).

Bug: http://b.android.com/214026
Change-Id: Ic7775d360ae4997f54f30fb75851879acaf8d824
(cherry picked from commit f6d8bba638baedc39d1d8f7bd3c69f4956819c71)
2016-07-19 15:42:40 +00:00
Diego Perez
c606e64ebc Merge "Add drawable caching" 2016-07-19 15:41:28 +00:00
Diego Perez
ae65e9fb7f Merge "Add support for appcompat preferences rendering" 2016-07-19 15:40:54 +00:00
Diego Perez
64f3352493 Add drawable caching
Change-Id: I4de4b55c1eddfd43e53ead27e2a284a4c18cb3cb
(cherry picked from commit b0ee962da6fe994db45e2a8221896ab67c2604be)
2016-07-19 10:32:51 +00:00
Diego Perez
8e8071bac1 Add support for appcompat preferences rendering
This CL adds new code to handle the support preferences classes. If the
support library is not installed in the project, it will use the regular
inflater as fallback.
This also ports the hotfix that used to live in Android Studio to
support "*Compat" preferences to the regular BridgePreferenceInflater.

Change-Id: I8ff34455d46b6188f0931e821d329224f6a0a343
(cherry picked from commit 90110d50f4c48ea7ec196a068f55b0eb86114c46)
2016-07-19 10:31:37 +00:00
Diego Perez
d43916b555 Fix leak in VPathRenderer
The pointer to the root group in the VPathRenderer is not freed anywhere
in the Java side so we need to take care of it on the "native" side.

Change-Id: I2ca60b1f0e975a0b5d29799c5f6f31b5f8d42b9d
(cherry picked from commit ffdb1b241d9458196403c8f16264aa7053487323)
2016-07-19 10:30:53 +00:00
Zak Cohen
9dc28243c0 Merge \\"Adds a screenshot wallpaper method to WallpaperManagerService.\\" into nyc-mr1-dev am: b4d4ce31ab
am: ee2f46485e

Change-Id: Ia7b738db6f73c89e97537f9b1c0d5cb7fd161616
2016-07-13 10:26:47 +00:00
Zak Cohen
3683fb1e1d Adds a screenshot wallpaper method to WallpaperManagerService.
Bug: 29963541

Change-Id: If0a574004f8bddf1ba170587a8187253fe045ef4
2016-07-12 17:18:36 +00:00
Robert Carr
8942204d93 Merge changes I38cff63b,Id3739bbc,If052cd8c into nyc-mr1-dev am: 30efa24b11
am: 0dbe6db014

Change-Id: I3f0fd113bf9dc063f3bc60301f9a7ddf7d16581d
2016-07-01 19:41:33 +00:00
Robert Carr
fd10cd1989 Force CROSSFADE rotation when launching from double tap gesture.
When activity transition triggers a rotation change, the starting
window will normally be the top window at the time we try
to select the window animation. However, these layout params won't
have the apps rotation animation set (as the client code will set that
on the real window, not the starting window). Eventually we would
like to add API to specify rotation animation via manifest to solve
this problem cleanly. In the mean time, we can force a specific rotation
animation from the double tap gesture, and clean up some camera
ugliness. We accomplish this by attaching an animation hint to
ActivityOptions.

Bug: 28838855
Change-Id: If052cd8cbae76651da43f3b4c590cd9dcc1afc0f
2016-07-01 11:05:40 -07:00
Diego Perez
f63ff008d5 Merge "Remove inspection_tool from inspectionProfiles" 2016-06-30 19:55:57 +00:00
Diego Perez
7d53410710 Merge "Updating unit tests so they match the expected output" 2016-06-30 19:55:40 +00:00
Jerome Gaillard
c796a98a60 Use a HashSet to store delegate references in layoutlib
More efficient than an ArrayList since we do a lot of remove operations.

Change-Id: Ic4c89df4560066f1a3ab0e71a3b180a9734f9cd6
(cherry picked from commit 12754d621b20e6a925999096ab6f21c4cbfe594a)
2016-06-29 14:57:15 +00:00
Diego Perez
3c4aed26e6 Remove inspection_tool from inspectionProfiles
Change-Id: I8aae3c2d6d46340fa3b4b27c9f217a7f1266d37d
(cherry picked from commit c5c7beca5292bfa248340059401f05e9d687bb2e)
2016-06-27 18:31:31 +00:00
Diego Perez
245e1be94b Updating unit tests so they match the expected output
Change-Id: Id9af601c00fc87f861adeed9f5aa99a3dc55b17e
(cherry picked from commit 768e4c952f335a825cd45b102556d5948ed09d0c)
2016-06-27 18:31:07 +00:00
Diego Perez
a540344b0a Merge "Avoid calling deepCopyNodes on null array" 2016-06-27 16:10:36 +00:00
Diego Perez
581fa36a13 Merge "Add support for AppCompat widgets" 2016-06-27 15:02:39 +00:00
Diego Perez
52053c9354 Merge "Add warning when RTL is used but not supported/enabled" 2016-06-27 10:40:56 +00:00