5210 Commits

Author SHA1 Message Date
Diego Perez
06a7ff3557 Add perf tests to Main
Test: N/A
Change-Id: I907ebdc28043e3ac92bae6b6a19451c2ca24423f
2017-03-01 16:06:59 +00:00
Jerome Gaillard
434968aa2f Add stroke width property used by animated vector drawables
This is for example used in displaying a checked radio button.

Test: Modified widget render test to include a checked radio button
Change-Id: I43074ce038f69f28c0cf5fb396d393722b02b142
2017-02-27 14:44:46 +00:00
TreeHugger Robot
bdecfe1445 Merge "Load hyphenation patterns for Bulgarian and Church Slavonic" 2017-02-24 01:14:01 +00:00
TreeHugger Robot
b5a0ef8188 Merge "AAPT2: Few tweaks to get shared-libraries working" 2017-02-23 20:24:27 +00:00
Jerome Gaillard
88403817a2 Add autofill service to BridgeContext
Test: layoutlib tests
Change-Id: I52b360a64518165eefee4250b1c32e9f5f87845d
2017-02-23 15:15:49 +00:00
Roozbeh Pournader
033b2226ba Load hyphenation patterns for Bulgarian and Church Slavonic
Patterns for Bulgarian (bg) and Church Slavonic (cu) are now loaded
too.

Also make changes to fontchain_lint.py, so it knows the script for Bulgarian
and Church Slavonic is Cyrillic.

Test: make -j works and creates .hyb files for bg and cu
Change-Id: I0586f6c49380279ef88fe952b5cfd2d3594c5524
2017-02-22 23:39:24 -08:00
Adam Lesinski
b5dc4bd49a AAPT2: Few tweaks to get shared-libraries working
Test: manual (building shared support library demo)
Change-Id: I4730645aa92ba1893baf67ffe35fbd4aac0f8e46
2017-02-22 19:54:43 -08:00
Adam Lesinski
d48944a745 AAPT2: Rename strip phase to optimize
- Allow resource deduping, version collapsing, and sparse resource
  encoding.

Test: manual
Change-Id: Ia4aa892ab5b06ba1d5ea4a6efb51b00bc3a980c4
2017-02-22 11:41:55 -08:00
Adam Lesinski
ceb9b2f80f AAPT2: Shared library support
Test: make aapt2_tests
Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
2017-02-22 11:16:13 -08:00
Diego Perez
5780637259 Merge "Set MockView.setGravity to public" 2017-02-21 15:20:20 +00:00
Diego Perez
c98c16ded8 Merge "Add support for aapt:attr attributes" 2017-02-21 12:55:14 +00:00
Diego Perez
67ac03043c Set MockView.setGravity to public
The method is used from Studio so it needs to be public.

Test: N/A
Change-Id: I603de9ae0c8b719f5173eff152cc2558f734017e
2017-02-21 10:41:18 +00:00
Diego Perez
bc9d2a13f0 Add support for aapt:attr attributes
Test: Tested from the studio side
Change-Id: Id506801f53cfc976c7352bd7f9632804862668b7
2017-02-21 09:34:49 +00:00
Diego Perez
8f52705b48 Merge "Fix BridgeContext.resolveThemeAttribute color parsing" 2017-02-21 09:30:05 +00:00
Jerome Gaillard
b01d3db742 Merge "Update FontFamily_Delegate following Change I1d6e1c4c" 2017-02-20 11:35:57 +00:00
Diego Perez
3d3e69ce6d Fix BridgeContext.resolveThemeAttribute color parsing
When passed a color, resolveThemeAttribute was not parsing the value
into the .data field.

Bug: http://b.android.com/232870
Test: Added new test
Change-Id: I9d91e3a70c24f1e71d9d89977fe79b0965e98893
2017-02-20 11:08:26 +00:00
Aurimas Liutikas
75e7d1d73e Removes an already defined warning in aapt.
Apps that expect to use the current SDK don't specify anything in their
manifest and the build system rightfully injects the current SDK.

Any apps that specify their own <uses-sdk> or versionCode are telling
the build system that they are purposely using some other minSdkVersion,
etc (support library demos).

Test: None
Change-Id: I0aba3a71e15703c7bcafcf4d35608a1851dd8567
Fixes: 34901699
2017-02-17 18:44:28 -08:00
Adam Lesinski
edb88a2b94 Merge "Add ResTable_sparseTypeEntry support" 2017-02-18 00:39:18 +00:00
TreeHugger Robot
96b9832163 Merge "API for accessing preloaded files cache" 2017-02-17 21:09:28 +00:00
Fyodor Kupolov
61221290f5 API for accessing preloaded files cache
Added @SystemAPI method Context.getPreloadsFileCache.

Bug: 31008665
Test: manual
Change-Id: Id61ab5e1b78d8bfbd40f61985406a8de4082b30f
2017-02-17 10:40:54 -08:00
Jerome Gaillard
1db0d3cd04 Update FontFamily_Delegate following Change I1d6e1c4c
Test: layoutlib tests
Change-Id: I3fda9b0eaf36d74c8a64f2a5c7aeb063b4df8d1a
2017-02-17 15:46:05 +00:00
Andrii Kulian
b047b8bd7e Report move to display for activities that handle config changes
When activity that is moved between displays handles all configuration
changes, it won't be restarted. This CL adds a callback to the client
to notify it about display change. Usually it will be followed by
onConfigurationChanged, except when configuration didn't actually change.
When activity is recreated, it won't receive onMovedToDisplay.

Bug: 34862802
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Change-Id: I9a9501cab788623ada15a31efb53e4b2378639fe
2017-02-16 17:33:59 -08:00
Diego Perez
b9014f356a Merge "Add BridgeXmlPullAttributesTest to the Main suite" 2017-02-16 17:47:10 +00:00
Jerome Gaillard
65febdd300 Merge "Fix LayoutlibTestCallback.getResourceId" 2017-02-16 13:31:38 +00:00
Jerome Gaillard
677f0d6c7c Merge "Update asm version in layoutlib following Change I2a6396e7" 2017-02-16 13:30:22 +00:00
Diego Perez
102ef6fd53 Merge "Set the correct class loader in Resources" 2017-02-16 12:14:14 +00:00
TreeHugger Robot
9809b8fdd6 Merge "Add functionality to overwrite the /etc/preloaded-classes file." 2017-02-16 00:49:16 +00:00
Adam Lesinski
c8f71aa67e Add ResTable_sparseTypeEntry support
Benchmarks on bullhead-userdebug show that there is a negligent
performance impact when using sparse entries on a 30% loaded
sparse type of 1000 resources.

Benchmark                                             Time           CPU Iterations
-----------------------------------------------------------------------------------
BM_SparseEntryGetResourceSparseLarge                255 ns        254 ns    2751408
BM_SparseEntryGetResourceNotSparseLarge             254 ns        254 ns    2756534

Bug: 27381711
Test: make libandroidfw_tests aapt2_tests
Change-Id: I051ea22f2f6b2bc3696e446adc9e2a34be18009f
2017-02-15 12:40:02 -08:00
Jerome Gaillard
3a73332350 Fix LayoutlibTestCallback.getResourceId
Return null instead of triggering a NPE when there are no resource of
the asked type.

Test: RenderTests.testFonts
Change-Id: Ib45ebdf2178e62cbd987082512fcbb009de3f1b2
2017-02-15 15:59:04 +00:00
Jerome Gaillard
d88767aa3d Update asm version in layoutlib following Change I2a6396e7
Test: layoutlib tests
Change-Id: I53f61b429bad3f919a6a22d52ac7bc3266190589
2017-02-15 15:34:50 +00:00
Diego Perez
196b731365 Set the correct class loader in Resources
The class loader in Resources is now used to inflate drawables. Because
layoutlib was using the system class loader, the drawables would fail to
inflate.
With this change, Resources will use the layoutlib class loader instead
of the system one.

Test: Tested from the studio side
Change-Id: I933ff68e704f9d3599b69cd74e98e44bdca3c789
2017-02-15 11:48:44 +00:00
Diego Perez
c5a8e06f2e Merge "Add dynamic font support" 2017-02-15 10:36:22 +00:00
Michael Rosenfeld
286839e40d Add functionality to overwrite the /etc/preloaded-classes file.
* Requires root, disable-verity, reboot, root before use.

Test: manual through UI and sequencing
Change-Id: I68965334776e130b8220a5814b2525109cf96800
2017-02-14 18:33:42 -08:00
TreeHugger Robot
7ad2067f98 Merge "Add API to track package changes" 2017-02-14 23:10:59 +00:00
Todd Kennedy
9106c64bf3 Add API to track package changes
After any package install, removal or update, save the changed
package and update a global sequence number. At any point, apps
can query for the packages changed since a particular sequence
number.

If a package is changed multiple times, it is only included once
in the change list.

Bug: 33865505
Test: Create sample app to query for changes and see which packages are changed after performing certain operations
Change-Id: Ia4646035362b16a97110e05f3f909ce385b48428
2017-02-14 12:44:50 -08:00
Colin Cross
4114a9597a Merge "Use asm-5.2 prebuilt" am: 6b32770d6d am: 6c1ac4dd80 am: 29fd14f9ee
am: 886d642fb6

Change-Id: I1c8d74fc0967521a9a52fdc5cac0f1216d6bff5c
2017-02-14 19:28:36 +00:00
Colin Cross
886d642fb6 Merge "Use asm-5.2 prebuilt" am: 6b32770d6d am: 6c1ac4dd80
am: 29fd14f9ee

Change-Id: I0b08a521058a82ca801f020bd63dc9ccb4bf3a28
2017-02-14 19:22:27 +00:00
Colin Cross
29fd14f9ee Merge "Use asm-5.2 prebuilt" am: 6b32770d6d
am: 6c1ac4dd80

Change-Id: Icc01bcd92c5b23198bb39ff382610c72b4bf1867
2017-02-14 19:17:24 +00:00
Diego Perez
789c4b4b14 Add dynamic font support
This CL allows loading fonts from resources.

Test: Added new fonts test
Change-Id: Ic82239121cc3f78f2a22b22de42e54575c1f2d98
2017-02-14 18:24:16 +00:00
Diego Perez
dacc137752 Merge "A bit of warning cleanup" 2017-02-14 15:25:37 +00:00
Diego Perez
62253b6c60 A bit of warning cleanup
Test: Covered by existing tests
Change-Id: I3f27540efdb47e3c1db02f85c67c81e36d159a79
2017-02-14 12:36:18 +00:00
Diego Perez
646b78173a Merge "Fixes for animated vector drawables" 2017-02-14 12:23:11 +00:00
Yohei Yukawa
ff54b306de Merge "Track event flow to IMMS#setImeWindowStatus" 2017-02-13 22:08:35 +00:00
Colin Cross
80e86bae0e Use asm-5.2 prebuilt
Test: m -j checkbuild tests cts
Change-Id: I37d40cc2e0406679394012aacd49f7ca9e51e3f6
2017-02-13 12:54:10 -08:00
Yohei Yukawa
6db3bfe33d Track event flow to IMMS#setImeWindowStatus
This is part of work to introduce historical debugging infrastructure
for Android IME.

In this CL, we will focus on the following two event flows.

 A1. IMMS#attachNewInputLocked() queues MSG_(RE)START_INPUT to deliver
     new InputConnection/EditorInfo to the current IME
 A2. The IME triggers IMS#onStartInput()/IMS#onRestartInput() and
     updates the following fields:
      - InputMethodService#mStartedInputConnection
      - InputMethodService#mInputEditorInfo

 B1. IME is expected to call back IMM#setImeWindowStatus() to notify
     its window visibility change to IMMS.
 B2. IMMS updates the following field if the caller is still the
     current IME.
      - InputMethodManagerService#mImeWindowVis

What this CL aims to do is to enable IMMS to access A1 state when it
was in B2 state, by considering that for given a B1 the last A2
happened before B1 is the cause of B1 and B2.

To do this, IMMS issues a binder token in A1 and each IME keeps it
so that it can be passed in B1. By using this Binder token as a key,
IMMS can keep tracking state snapshot taken from each A1. Note that
those state snapshots keep alive until the Binder token's proxy in the
IME process loses strong reference from its GC root.

Test: Make sure `adb shell dumpsys input_method | grep mImeWindowVis`
      matches to the IME window visibility.
Test: Make sure the current IME is not receiving any
      InvalidParameterException from IMMS.
Bug: 35079353
Change-Id: I9921b381e02106dbffff5e0b3d13f0a1245ce807
2017-02-13 12:04:41 -08:00
Diego Perez
d432860074 Merge changes Ic3affb60,If09a6623
* changes:
  Fix NopCanvas initialization
  NopCanvas is only hw accelerated during construction
2017-02-13 18:25:31 +00:00
Diego Perez
74f36500a9 Fix NopCanvas initialization
Reverse the logic since the field wouldn't be initialized to true before
super is called.

Test: Layoutlib tests
Change-Id: Ic3affb608bdf3306ada25e2dd986a48f6caae202
2017-02-13 15:59:34 +00:00
Diego Perez
be4d4fa3df NopCanvas is only hw accelerated during construction
During construction, we want to make NopCanvas as light as possible so
we just say that we are hw accelerated.
This caused some crashes further down the line for some views that
thought that NopCanvas was hw accelerated. From now on, NopCanvas is
only hw accelerated during construction.

Test: Covered by the existing tests
Change-Id: If09a662312e5c90d011e7ab2cbb524ef7b420d12
2017-02-13 15:59:26 +00:00
Diego Perez
44467a0f61 Remove custom service Class -> name mapping
Keeping the mapping manually is very error prone and the
SystemServiceRegistry already does it for us.

Bug: http://b.android.com/231975
Test: Added new test
Change-Id: I507c4a9d5f0821a5a237ee27f5e97c5cd9040223
2017-02-13 15:57:50 +00:00
Diego Perez
4b0e604090 Fixes for animated vector drawables
- Make sure that all ImageViews containing animated vector drawables
have the animation started.
- VGroup does not need to copy the children as they are copied by the
VectorDrawable initialization

Test: Covered by existing animated vector drawable tests
Change-Id: Ic0fc09ee5c98b3747dbc6fe311cdeea2c8dba380
2017-02-13 15:56:04 +00:00