5386 Commits

Author SHA1 Message Date
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
TreeHugger Robot
639c371e96 Merge "Introduce @SoftInputModeFlags annotation" 2017-02-13 03:36:07 +00:00
Yohei Yukawa
22dac1c8df Introduce @SoftInputModeFlags annotation
Doing this allows us to annotate integer values that should corresponds
to WindowManager.LayoutParams#softInputMode.

Test: There should be no behavior change.  RetentionPolicy.SOURCE
      annotation should change nothing in production code.
Test: checkbuild
Bug: 32784563
Bug: 35079353
Change-Id: I96300b090edce327d0515c740183abe91ded6bac
2017-02-12 16:54:16 -08:00
Pierre Lecesne
5b12734fb0 Merge "Allow for multiple preferred densities in the strip command." 2017-02-12 18:44:01 +00:00
Pierre Lecesne
672384b41e Allow for multiple preferred densities in the strip command.
Test: Unit tests pass.

Change-Id: I1f27ac8c36ff3489e4c8e4fce7f3d9cb31df6906
2017-02-12 15:57:41 +00:00
TreeHugger Robot
2c728430a7 Merge "fix warning: Potential leak of memory pointed to by 'target'" 2017-02-11 04:20:43 +00:00
Yohei Yukawa
efdb428959 Merge "Eliminate out-of-sync IMM#mFullscreenMode error" 2017-02-09 16:55:04 +00:00
TreeHugger Robot
024d22fdb7 Merge "AAPT2: Fix pseudolocalization to respect <xliff:g>" 2017-02-09 16:17:18 +00:00
Yohei Yukawa
2bc66171cc Eliminate out-of-sync IMM#mFullscreenMode error
As explained in the commit message of my previous CL [1], we have
had a design issue in how to notify the full-screen mode change
from the IME to InputMethodManager running in the target application.

Histrically we have done this by using hooking the following IPC
from the IME to the target application.

  InputConnection#reportFullscreenMode()

However, since we also want InputConnection to be deactivated in some
situations such as the when the target application is no longer
focused. In other words, InputConnection is not a reliable way to
notify something.

As a result, we have suffered from many stale state issues.
Bug 21455064 and Bug 28157836 are such examples.  In Android N, we
introduced yet another hack to work around those issues, but it is
really time to fix the protocol design instead.

The new strategy is to rely on internal IPCs provided by
InputMethodManager to deliver such critical notifications from one
process to the other. This is actually more natural because our goal
is to make sure that InputMethodManager#isFullscreenMode() always
returns the latest value as long as the caller is the focused
application.

For backword compatibility, applications that are monitoring
this callback should continue working, as InputMethodManager emulates
the previous behavior.  However, as updated in JavaDoc, IMEs are no
longer allowed to invoke InputConnection#reportFullscreenMode(),
which should be OK because even on previous releases IMEs should rely on
InputMethodService#updateFullscreenMode() instead.

 [1]: Iba184245a01a3b340f006bc4e415d304de3c2696
      1544def0facda69c210b0ae64b17394ea2860d39

Fixes: 28406127
Test: Make sure Bug 21455064 is still fixed.
       1. Input some words in extract mode.
       2. Select a word.
       3. Perform copy.
       4. Select a word.
       5. Rotate the device.
       6. Try to select a word.
       7. Make sure he word is selected and action mode starts.
Test: Make sure Bug 28157836 is still fixed.
       1. Rotate device to landscape mode.
       2. Tap on EditText and start full screen extracted mode.
       3. Rotate device to portrait mode.
       4. Long press to start action mode.
       5. Make sure Action mode gets started.
Test: `adb shell dumpsys input_method` to make sure that fullscreen
      state is synchronized across the app, IMMS, and the IME.
Change-Id: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
2017-02-09 00:51:18 +00:00
TreeHugger Robot
42c401adbd Merge "AssetManager2: Add GetResourceId" 2017-02-08 16:50:33 +00:00
Adam Lesinski
7542162cb1 AAPT2: Fix pseudolocalization to respect <xliff:g>
The XLIFF 'g' tag specifies content that should NOT be translated.
AAPT2's pseudolocalization process should respect it.

Bug:34064599
Test: make libandroidfw_tests
Change-Id: Ice437d7f0ff246730ee04896fd035e2d846148fb
2017-02-08 06:23:45 -08:00
Adam Lesinski
af463961bc Merge "AAPT: Fix --feature-of to allow non-public symbol visibility" 2017-02-08 14:07:22 +00:00
Adam Lesinski
929d6517df AssetManager2: Add GetResourceId
Add ability to lookup a resource by name.

Test: make libandroidfw_tests
Change-Id: I262ba5ce4c9892458226fbdb44cf21f9877fb92d
2017-02-08 06:04:52 -08:00
Diego Perez
97344168cb Add BridgeXmlPullAttributesTest to the Main suite
Test: Not needed
Change-Id: Ic00e6ef6b0fffd7ad480d37cfd57b2859efe1fbb
(cherry picked from commit 836d53375c0bc98fa5ee5f591901895cc1a305bd)
2017-02-08 10:22:40 +00:00
Diego Perez
c357e35897 Merge "Upgrade thumbnails size by 4x" 2017-02-08 10:21:39 +00:00
Diego Perez
47ba263768 Merge "Fix support for enum attributes in BridgeContext" 2017-02-08 10:21:27 +00:00
Winson Chung
2a82fe587b Refactor PiP logic in preparation for expanded state.
- #1: Move logic for handling IME size changes into SysUI, and only rely
      on PinnedStackController to provide bounds when first entering
      PiP and on rotation
- #2: Doing #1 allows us to move PipMotionHelper to SysUI completely, which
      lets us aggregate the animation calls out of PipTouchHandler
- #3: Add proper callbacks to the listeners when the movement bounds
      changed from config change, ime change, or aspect ratio change. This
      allows SysUI to calculate the associated movement bounds for the
      expanded state, and we can then remove the corresponding WM call.
      It also means that SysUI is the only thing that needs to know about
      the expanded state.
- #4: Fix issue where TV was getting the default bounds, not taking the
      aspect ratio when the PiP was entered into account.  Doing #3
      allows us to report the right bounds.
- #5: Remove dead code related to edge snapping/minimizing now that they
      are on by default and associated tuner setting, and controller
      callbacks

Test: android.server.cts.ActivityManagerPinnedStackTests (all existing tests pass)

Change-Id: I3ef361bdf8d44094b4c0a11c70ba4db7d697fdec
Signed-off-by: Winson Chung <winsonc@google.com>
2017-02-07 08:26:36 -08:00
Diego Perez
c0919ba4cb Upgrade thumbnails size by 4x
Test: Updates existing tests
Change-Id: I822ea4b35ee56b8c2e193b7123e6e99719499359
2017-02-07 11:10:57 +00:00
Diego Perez
abb080d749 Fix support for enum attributes in BridgeContext
Test: Updated BridgeXmlPullAttributesTest
Bug: http://b.android.com/231347
Change-Id: I5fd8b46155ccea6c9b65787f311a0887fa4b4806
2017-02-07 10:29:09 +00:00
Pierre Lecesne
0355dccc85 Merge "Only compress files that were already compressed in the original APK." 2017-02-04 03:54:43 +00:00
Adam Lesinski
558a63056e Merge "AAPT2: Support CtsContentTestCases build" 2017-02-04 03:44:25 +00:00
Pierre Lecesne
fa131d5312 Only compress files that were already compressed in the original APK.
Also fix a log message.

Test: Manually. Unit tests pass.

Change-Id: Iea236bbcfbe1a0a0894ce1bfce09c19208c5a0bc
2017-02-03 19:49:37 +00:00
Pierre Lecesne
2968cbf4aa Strip the resources from the APK using the TableSplitter.
Test: Unit tests pass.

Change-Id: I1dd71581113fb9a6feeefa9c794cc282529c3754
2017-02-03 18:57:09 +00:00
Pierre Lecesne
fc866baa33 Merge "Iterate over the zip entries in order." 2017-02-03 18:51:42 +00:00
Pierre Lecesne
265066c51d Merge "Expose whether a file was compressed before being loaded in memory." 2017-02-03 18:50:16 +00:00