4379 Commits

Author SHA1 Message Date
Jeff Sharkey
331279b239 More lint checks.
-- Error if Parcelable classes aren't final.
-- Warn that MIN_/MAX_ constants that should be dynamic.
-- Error if throwing raw RemoteException.
-- Warn if methods accept File without stream variants.
-- Ignore upstream ICU project.

Bug: 27410989
Change-Id: I12d843e63078dc696c1798a20e088608f1ba9ed1
2016-02-29 16:19:46 -07:00
Diego Perez
1db8850b79 Merge "Fix StackMap renaming in Java 8" into nyc-dev 2016-02-29 19:01:56 +00:00
Diego Perez
70f97ba54a Fix StackMap renaming in Java 8
With the move to Java 8 of layoutlib, we now need to make sure that the
method stackmaps are kept up to date or the class verification step will
fail. Up until now, we were ignoring them but this caused TestDelegates
to start failing.
This updates the code to make sure that when we modify a class name, we
also update the stackmap in the calls.

Change-Id: Iddbde7454f065ddb8da5bb1ab499ec0616f9b4fe
2016-02-29 10:24:52 +00:00
Adam Lesinski
afc79be228 AAPT: Allow duplicate attribute definitions if identical
This allows libraries to coexist a bit easier, since a lot of them
declare the same attribute. When used together they cause errors.
Bug:27101533

Change-Id: I649cf17bc587c4814f849d5ac522daf74495adcf
2016-02-26 15:57:59 -08:00
Muyuan Li
94ce94e960 Allows components to register shortcut key.
The registered shortcut will be called from PhoneWindowManager,
before dispatching

Change-Id: If26128939b45a639c8895719a7a23ca433f39fd9
(cherry picked from commit 4da863c5a8872dcabb179a978a2b2157d9081679)
2016-02-26 22:30:34 +00:00
Adam Lesinski
913a2fdb06 Merge "Revert "AAPT: Allow duplicate attribute definitions if identical"" into nyc-dev 2016-02-25 23:13:24 +00:00
Adam Lesinski
525db2489d Revert "AAPT: Allow duplicate attribute definitions if identical"
This reverts commit c25283b5e206ceae2aa6eb01877b79c3c1f0adfb.

Change-Id: I2f42a4360fa53c4333494afe0178dcec56d62d8e
2016-02-25 23:13:08 +00:00
Adam Lesinski
ddbad32341 Merge "AAPT: Allow duplicate attribute definitions if identical" into nyc-dev 2016-02-25 21:00:22 +00:00
Todd Kennedy
fe01ea05dd Merge "Revert "Remove deprecated methods / classes"" into nyc-dev 2016-02-24 22:45:50 +00:00
Todd Kennedy
5cbeb59026 Revert "Remove deprecated methods / classes"
This reverts commit 9706c01f9b92cee64bb84782138735225c8588e0.

Change-Id: I14c53ab140220e48f6728b1173ea58760bbeb7f9
2016-02-24 22:45:00 +00:00
Todd Kennedy
ca67844e0c Merge "Remove deprecated methods / classes" into nyc-dev 2016-02-24 21:02:58 +00:00
Jorim Jaggi
c87e2b46fb Fix build
Change-Id: Id21200a8239908c18379d67639c090ccfd3772f2
2016-02-24 18:48:42 +00:00
Diego Perez
7eeacc27e3 Fix FontFamily nAddFontWeightStyle in nyc
Change-Id: I156812384c758edbd6efa23fd18a0ce7b9b82993
2016-02-23 12:20:11 +00:00
Yohei Yukawa
5cf733f89b Fix build breakage.
This follows up to my previous CL [1], which forgot to update
BridgeIInputMethodManager.java (again!).

  [1] I56934f18e30d90fcdf77bcbb0c35a92a5feb1b82
      05c25f8a3a033816ac25aa5cd7db5b1ab495bc3f

Bug: 25373872
Change-Id: I0643069fd0b677115c89c340b7a23f1d12bd7988
2016-02-22 15:11:49 -08:00
Adam Lesinski
c25283b5e2 AAPT: Allow duplicate attribute definitions if identical
This allows libraries to coexist a bit easier, since a lot of them
declare the same attribute. When used together they cause errors.
Bug:27101533

Change-Id: I10327251636392e810637a79e7c9aa514f3f07a6
2016-02-22 09:25:06 -08:00
Diego Perez
26b2754310 Remove layoutlib RunQueue implementation
Change-Id: Id2b666f086a48f101ff7ef4177fe28ad17d10783
2016-02-22 17:16:50 +00:00
Diego Perez
18780f60ef DO NOT MERGE: Fix Canvas memory leak
am: b75a0426d8

* commit 'b75a0426d8c2339f2d552f96cc4dfcd86deb3447':
  DO NOT MERGE: Fix Canvas memory leak
2016-02-22 16:19:12 +00:00
Diego Perez
f5650cf3a3 Fix Canvas memory leak
Every RenderSession would call the AttachInfo.setAttachInfo but wouldn't
issue a View.dispatchDetachedFromWindow.
This caused some Canvas to be slowly leaked in the DelegateManager in
every session.

Change-Id: Iec418a86f5c5e55c2a2860ef945268c51c0e8173
2016-02-22 15:01:30 +00:00
Diego Perez
b75a0426d8 DO NOT MERGE: Fix Canvas memory leak
Every RenderSession would call the AttachInfo.setAttachInfo but wouldn't
issue a View.dispatchDetachedFromWindow.
This caused some Canvas to be slowly leaked in the DelegateManager in
every session.

Change-Id: Ib0392303e6d00a4fe5494ae484f28135b1fe6b28
2016-02-22 14:09:09 +00:00
Diego Perez
4f2103631a Merge "Revert "Fix Canvas memory leak"" into mnc-ub-dev
am: 44f92b00d1

* commit '44f92b00d1a060773625de5884fc86e7218e2dd5':
  Revert "Fix Canvas memory leak"
2016-02-19 20:18:28 +00:00
Diego Perez
44f92b00d1 Merge "Revert "Fix Canvas memory leak"" into mnc-ub-dev 2016-02-19 20:09:09 +00:00
Diego Perez
cf93572889 Revert "Fix Canvas memory leak"
This reverts commit e82bd72b6e7ab3135d3b28fc2c2694d08af45c3d.

Change-Id: Ie9ef25b17d5f725d5054c039992a8cd2912868a6
2016-02-19 20:07:44 +00:00
Diego Perez
1d3c41e563 Merge "Fix Canvas memory leak" into mnc-ub-dev
am: bad0e07ee9

* commit 'bad0e07ee9163d6b0f0bf73ad591ff6e453199ef':
  Fix Canvas memory leak
2016-02-19 18:08:00 +00:00
Diego Perez
bad0e07ee9 Merge "Fix Canvas memory leak" into mnc-ub-dev 2016-02-19 17:58:17 +00:00
Diego Perez
e82bd72b6e Fix Canvas memory leak
Every RenderSession would call the AttachInfo.setAttachInfo but wouldn't
issue a View.dispatchDetachedFromWindow.
This caused some Canvas to be slowly leaked in the DelegateManager in
every session.

Change-Id: I0322767e5fffc6053ce1be852dd8ca904dfaa137
2016-02-19 17:57:36 +00:00
Jeff Sharkey
003ee19851 Merge "Make BackupManager encryption aware." into nyc-dev 2016-02-18 19:26:36 +00:00
Diego Perez
16e17a7730 resolve merge conflicts of aa9c9fb29e to nyc-dev
Change-Id: Id46238cb759f2d63a072cb7ea8a27c5fd8a6672e
2016-02-18 18:28:50 +00:00
Jeff Sharkey
2c1ba9a961 Make BackupManager encryption aware.
Backup requires both CE and DE storage to be available, so delay
spinning up the backup system until the user is unlocked, since
that's when CE storage becomes available.  Note that devices without
FBE immediately transition USER_SYSTEM into the unlocked state,
since their CE is always available.

Offer to backup and restore files under both CE and DE.  Since DE
is effectively the same as CE, most logic is simply duplicated for
now, but it could be simplified in the future.  Since system apps
can force their default storage location to DE, we always build
explicit CE and DE paths.

Add getDataDir() to give clean access to the top-level private data
directory, but disclaim that apps shouldn't create files there.

Bug: 26279618
Change-Id: Ic34a4b330223725db93b1d0f5c9dffc88002c61f
2016-02-18 10:54:11 -07:00
Deepanshu Gupta
3b6ea2e3a8 Entry -> Map.Entry. Fixes build break
Change-Id: I72fe70d6f617c7753a278e134ac22d71125d8def
2016-02-17 20:51:08 -08:00
Deepanshu Gupta
7914e4ca03 Switch LayoutLib to Java 8
The main build hasn't swtiched to java 8, but lambdas are already used
in layoutlib. This fixes the build break.

Change-Id: I4dd69ebd736179067899f5d86d3608d5fdb03d93
2016-02-17 20:50:00 -08:00
Deepanshu Gupta
f0c5b7af6f Merge "LayoutLib fixes for N" into nyc-dev 2016-02-18 03:04:16 +00:00
Adam Lesinski
3581fbc8ad Merge "AAPT2: Implement density stripping and initial Split support" into nyc-dev 2016-02-18 02:32:33 +00:00
Adam Lesinski
355f285ffd AAPT2: Implement density stripping and initial Split support
When a preferred density is supplied, the closest matching densities
will be selected, the rest stripped from the APK.

Split support will be enabled in a later CL. Command line support is still
needed, but the foundation is ready.

Bug:25958912
Change-Id: I56d599806b4ec4ffa24e17aad48d47130ca05c08
2016-02-17 18:17:25 -08:00
Deepanshu Gupta
491523d52c LayoutLib fixes for N
Moves LayoutLib to Java 8 - YAY!
Fix delegates

Change-Id: I098996e43e330e995d33f12df1c16355bbc02f0f
2016-02-18 02:10:24 +00:00
Diego Perez
aa9c9fb29e Replace SimpleDateFormat implementation
This will process all the classes and replace all the uses of
java.text.DateFormat and java.text.SimpleDateFormat with the
android.icu.text. package implementations. The original ones do not
match the Android platform behaviour.

Change-Id: Id55f103c21117a8d6403bf2124b6c1a0e1fb2f71
2016-02-17 18:54:17 +00:00
Andrei Stingaceanu
eb84b1843a Suspend packages - one call for multiple packages
Refactor setPackageSuspended into setPackagesSuspended. The rationale
is that the consumers of this API are likely to want to remove
multiple packages at once. Rather than calling the API N times, call
it just once.

The good part is that we already have the broadcast intent for
suspended packages take an array so only one broadcast. Less stress
on the system.

Another good part is that (right now) we only have one consumer of
this API and it will be easy to make changes once this CL goes in.

As a shell command, for consistency only allowed one package at
a time.

Bug: 22776761
Change-Id: Ic8b8cf64d0a288ea3a282bb7b72f9d663b3b0049
2016-02-17 15:14:33 +00:00
Andrei Stingaceanu
5ae4e73ef0 Merge "Suspend packages - new API for retrieving the suspended status" into nyc-dev 2016-02-17 11:57:51 +00:00
Todd Kennedy
9706c01f9b Remove deprecated methods / classes
Now that we've moved the majority of system components to the
PackageInstaller, we can remove the majority of the "installPackage"
methods and the VerificationParams/ContainerEncryptionParams
classes. There are still some lingering references to the two
installPackage() methods left [both internal and external; play
is using these methods via reflection].

Bug: 24542768
Change-Id: Ib65323d842d9f0e7fed60e37e6b5f103c94c859b
2016-02-16 13:39:55 -08:00
Andrei Stingaceanu
355b232d79 Suspend packages - new API for retrieving the suspended status
Instead of always rebuilding the full ApplicationInfo for a
package when callers are only interested in the suspended status
add a new fast API in Packagemanager (which only checks the
suspended user setting for the requested package and returns
a boolean) and change the appropriate caller code too.

Bug: 26794775
Bug: 22776761
Change-Id: Ide8428ef734479360d5a8a75fd8e0ed8ddf2da7a
2016-02-16 14:57:29 +00:00
Jeff Sharkey
115d2c189a Add feature versions for devices and apps.
We're starting to see more instances of device features that will
increment separately from the SDK API level, such as camera HAL,
GPU capabilities, Bluetooth, and other hardware standards.

This change adds the ability for device features to specify a
version, which is defined to be backwards compatible.  That is, apps
requesting an older version of a feature must continue working on
devices with a newer version of that same feature.

When a version is undefined, we assume the default version "0".

Bug: 27162500
Change-Id: If890bf3f3dbb715e8feb80e7059a0d65618482ea
2016-02-15 17:45:42 -07:00
Adam Lesinski
5f7c461be6 AAPT2: Fix source output when error occurs in style
We were serializing the wrong Source when writing to protobuf

Change-Id: Ib65e962ebc1244ddf4af0e5666aaaebe5f7864a8
2016-02-12 23:38:08 -08:00
Adam Lesinski
923e6342fb Merge "AAPT2: Introduce notion of 'product' to ResourceTable" into nyc-dev 2016-02-13 06:28:06 +00:00
Adam Lesinski
e4bb9eb5af AAPT2: Introduce notion of 'product' to ResourceTable
This allows us to preserve the various product definitions during the compile
phase, and allows us to select the product in the link phase.

This allows compiled files to remain product-independent, so that they do not need
to be recompiled when switching targets.

Bug:25958912
Change-Id: Iaa7eed25c834b67a39cdc9be43613e8b5ab6cdd7
2016-02-12 22:21:48 -08:00
Vladislav Kaznacheev
989b58a633 Update pointer icon when View.setPointerIcon is called
Currently the updated pointer icon is only displayed after
the next mouse move.

Bug:27107871
Change-Id: Ieed57b07fe44699735179cf57968a9bb08981396
2016-02-12 16:55:53 -08:00
Ben Wagner
a87b07d7fa Add support for gx font variation axes.
This adds an 'axis' child element to the 'font' element. The 'axis'
element has attributes 'tag' (a four byte identifier) and 'stylevalue'
(a float value) to the parser. This also modifies reading the font file
name in a backwards compatible fashion by using only the direct #text
children of the 'font' element. (Both the Minikin and Skia parsers now
allow the font file name on a separate line in the fonts.xml file).

This information is then passed through to Skia in order to select the
desired variation. The Skia parser already parses this way and has for
some time, so Chrome and WebView can already read this format.

Change-Id: I15623fe864fa92b2bf0705af5e389daedfb77e5c
(cherry picked from commit b8e367fb7428076ff2e4aa2a97adaed1ef806e92)
2016-02-12 16:28:35 +00:00
Adam Lesinski
d7d584b225 Merge "AAPT: Remove warnings for public resources without comments" into nyc-dev 2016-02-12 01:42:16 +00:00
Adam Lesinski
9e1923d02f AAPT: Remove warnings for public resources without comments
There are so many public resources that do not warrant comments
that having a warning that no one cares about is just producing
log spam.

Bug:21495023
Change-Id: I84e3b39c7139ee67fb5cb711d5ab466d8f4ef2e0
2016-02-11 14:17:25 -08:00
Jerome Gaillard
69d9feb938 Layoutlib supports rounded corners of different sizes am: 3381cde9f2
am: 6f35d2c6ea

* commit '6f35d2c6ea1d18decd6b646035fd02fd5b1f0256':
  Layoutlib supports rounded corners of different sizes
2016-02-11 17:11:33 +00:00
Jerome Gaillard
3381cde9f2 Layoutlib supports rounded corners of different sizes
Bug: http://b.android.com/29098
Change-Id: I4e7dc3810559b509baf5ea306221c1d2504be0e1
2016-02-11 12:26:50 +00:00
Svetoslav Ganov
3552418fcf Merge "Fix build" into nyc-dev 2016-02-10 04:46:07 +00:00