2667 Commits

Author SHA1 Message Date
Deepanshu Gupta
a0904bf7aa Add layoutlib tests to DIST_DIR
Add the layoutlib and layoutlib-create tests to DIST_DIR for sdk
targets. These can be used for continuous testing on the build server.

Change-Id: I747dddcddfd8009937668bec4d75cb99bf63235f
2014-09-05 14:01:27 -07:00
Jeff Sharkey
8b9c97a4e2 Merge changes I10ab0b4a,Id32dcbd5 into lmp-dev
* changes:
  Catch incompatible API regressions.
  Add blame to API lint, some exemptions.
2014-09-04 22:49:22 +00:00
Jeff Sharkey
037458a5ba Catch incompatible API regressions.
Ignore deprecation, synchronized, and throws definitions.  Look
through full inheritance hierarchy to catch refactored classes like
BaseBundle.

Change-Id: I10ab0b4a0ef64e7508f38d0c223f08711293d643
2014-09-04 15:46:23 -07:00
Deepanshu Gupta
cd0bb17d30 Remove warning for null entries in resource array.
Change-Id: I32e0b8129e29f3e1e5a472b26e16f3fd06d4b91b
2014-09-04 12:54:26 -07:00
Jeff Sharkey
1498f9c615 Add blame to API lint, some exemptions.
Now offers to parse the output of git blame, and includes the last
person to modify that API for each reported failure.

Add more exemptions, and check for boolean setFoo() method inside a
separate Builder inner class.

Change-Id: Id32dcbd5edf17d2360e4f782110bc1c445f7936e
2014-09-04 12:45:36 -07:00
Deepanshu Gupta
a780eee462 Merge "Resolve color xml attributes properly. [DO NOT MERGE]" into klp-modular-dev 2014-09-04 01:53:38 +00:00
Deepanshu Gupta
708df7bc45 Merge "Remove ANDROID_BUILD_TOP from intelliJ path variables." into lmp-dev 2014-09-04 01:51:55 +00:00
Deepanshu Gupta
db0b8a1997 Merge "enums in dimension attributes." into lmp-dev 2014-09-04 01:48:24 +00:00
Deepanshu Gupta
351ed32961 Merge "Null out "@null" attributes." into lmp-dev 2014-09-04 01:48:14 +00:00
Deepanshu Gupta
bcbe8fcdb1 Merge "LayoutLib: Fix warnings in ResourceHelper." into lmp-dev 2014-09-04 01:46:58 +00:00
Deepanshu Gupta
a7c2419ec9 Merge "LayoutLib: Allow '+' in float attributes." into lmp-dev 2014-09-04 01:46:42 +00:00
Deepanshu Gupta
d75edc41a6 Merge "Fix invalid conditional check." into lmp-dev 2014-09-04 01:46:14 +00:00
Deepanshu Gupta
8a2ff1ecd9 Merge "Build layoutlib_create tests." into lmp-dev 2014-09-04 01:45:36 +00:00
Deepanshu Gupta
b988c8fa66 Build layoutlib_create tests.
Change-Id: Ia13a090f8ec29b2b2a107825b6a13d7db77e6d61
2014-09-03 12:57:12 -07:00
Deepanshu Gupta
1a12b80569 LayoutLib: Fix warnings in ResourceHelper.
Fix intelliJ warnings in ResourceHelper. Most of them just change
boolean checks "x == false" with "!x".

Change-Id: I278645e2807affd8b3183a4a6f5e4fa2ab7b3d21
2014-09-03 11:59:33 -07:00
Deepanshu Gupta
458f2a7bbb LayoutLib: Allow '+' in float attributes.
Earlier change to fix the invalid conditional check inadvertedly
disallowed '+'.

Change-Id: I75a37926681fe3a496482d6fb75161ac75326109
2014-09-03 11:59:22 -07:00
Jeff Sharkey
294f0de15b More API lint checks.
When offering a helper Service, etc, all platform provided methods
should be marked final.  Otherwise, if available for developer to
override, they should follow onFoo() style naming.

Catch anyone returning concrete collections types, and look for
overlapping flags.

Change-Id: I29d95f3dff78a4da968a46f10be89eada509648c
2014-08-29 17:41:49 -07:00
Adam Lesinski
5283faba4a Change platformBuildVersionCode to name in aapt dump badging
Change-Id: Ie3972105b3f6a727682f91851f7a99b05bb28e1a
2014-08-29 11:27:00 -07:00
Adam Lesinski
b32063822b Merge "Stamp platform version code into app Apks" into lmp-dev 2014-08-29 01:54:15 +00:00
Jeff Sharkey
932a07cefe Teach API lint about package layering!
Now it can identify layering violations, like when something deep in
android.os depends on android.app.

Change-Id: I94606c642195b3ed7558ff6979ed4a181cd85fa2
2014-08-28 16:16:07 -07:00
Jeff Sharkey
8190f4885b Lint tool for current.txt.
Detects common public API mistakes, making it easy to quickly scan
across all changes in a new API level.

Builds in-memory representation of the current API, then runs various
detectors over the classes.  It collects failures, and can ignore
known failures from a previous API level.

Example usage:

$ python frameworks/base/tools/apilint/apilint.py \
    frameworks/base/api/current.txt \
    prebuilts/sdk/api/21.txt

Change-Id: Ie1f88894baf9f79e4b11e78c47f848ea5e25fc25
2014-08-28 15:31:35 -07:00
Adam Lesinski
ad2d07d2d9 Stamp platform version code into app Apks
The versionCode of theframework resources that an app is built against
gets stamped inside an app's AndroidManifest.xml in the <manifest>
tag as "platformBuildVersionCode" and "platformBuildVersionName"
attributes.

Bug:17207635
Change-Id: Id573c3dffcbca38eec9c0eb3e89f4a547e3361d3
2014-08-27 18:28:49 -07:00
Deepanshu Gupta
ca22ba9eaf Fix invalid conditional check.
The check was always false. This wasn't really a problem since the regex
check later took care of it. But it's just wrong to leave such mistakes
in the code once they are noticed.

Change-Id: I84270a96141428bf15949ce8c881d2e4a2aa95f6
2014-08-26 16:33:14 -07:00
Deepanshu Gupta
bc34eb11f6 enums in dimension attributes.
enums in resources were only read for integer attributes. This change
parses the enums for dimension resources also. This also means that we
don't have to hardcode the resolution for match_parent and wrap_content.

TODO: Fix this for all resource types.

Bug: http://b.android.com/75285
Change-Id: I86752b2322ea017499942a87568ba5c54b8654e4
2014-08-26 14:02:25 -07:00
Adam Lesinski
3aa6076083 Merge "Have R classes generate their own reference rewrite logic" into lmp-dev 2014-08-26 18:23:57 +00:00
Winson Chung
5c1b42e4f5 Merge "Multiple performance changes to speed recents invocation/app launching time. (Bug 16987565)" into lmp-dev 2014-08-26 18:23:10 +00:00
Deepanshu Gupta
d4cf391c61 Null out "@null" attributes.
Remove references to the  resourceValue for "@null". This saves needless
checking for "@null" every time an attribute is requested.

Change-Id: I816e78619fa0b1ddcacd1ef5ac90765e30a9a44c
2014-08-25 21:04:10 -07:00
Adam Lesinski
1e466385d4 Have R classes generate their own reference rewrite logic
Change-Id: I0e5b8311fc3479d966a49f9acf0d4c32a6a024d3
2014-08-25 20:04:07 -07:00
Winson Chung
a4ccb86ddc Multiple performance changes to speed recents invocation/app launching time. (Bug 16987565)
- Reverting changes to the existing thumbnail transition to prevent breaking applications
  that currently depend on that transition.  As a result, we need to create a new, hidden,
  aspect-scaled thumbnail transition, and instead use that thumbnail to animate the
  recents header so that we don't have to wait to do that inside the Recents activity.

  In order for this to work, we also have to ensure that the thumbnail surface destruction
  is synchronized with the application that is currently closing (when going down to
  recents) or opening (when coming back up).  The current thumbnail is destroyed when the
  animation ends, but that can be at least 1 frame before the surface for the animating
  window is destroyed.  We change this by deferring destruction of this thumbnail window
  to the animation that is being closed.

  Especially on the way up, not having to wait for us to hide the header before doing the
  transition up can save us the duration of that first animation (> 100ms).

- Other optimizations:
  * No longer creating a new stack view on each transition to calculate the target rect
  * Removing unnecessary call to get the thumbnail when transitioning up/down (the actual
    window does its own animation.
  * We reduced numerous system calls per task by adding a flag to ignore home-stack tasks
    and caching the activity label and icon (and task description icon).  These caches
    follow the same eviction schemes as the thumbnail and icon cache.

- Also tweaked the touch slop for the nav bar swiping gesture to prevent conflicting with
  tapping on home (Bug 17109581)

Change-Id: Ica697aad788051a9203edd9351c583e1cb038a71
2014-08-25 18:52:32 -07:00
Deepanshu Gupta
ffee9b2740 Fix "@null" resource values in LayoutLib. [DO NOT MERGE]
Bug: http://b.android.com/74072
Change-Id: Ib84906d86772ac3df2407e71ad2167797bec4542
(cherry picked from commit c9cd725f1013bed27e6f6594b176c10a6a4c0f16)
2014-08-26 00:48:18 +00:00
Adam Lesinski
31245b4f06 Introduce anydpi density resource qualifier
This is meant to be used with scaleable vector
drawables, and are chosen as the best match unless
there is a configuration that matches the density
requested exactly.

Bug:17007265
Change-Id: Ic3288d0236fe0bff20bb1599aba2582c25b0db32
2014-08-25 17:47:30 -07:00
Deepanshu Gupta
cc7ccc3fc1 Resolve color xml attributes properly. [DO NOT MERGE]
Color attributes were not being converted to int properly. The
conversion to int was a simple string to int using base 16. This change
resolves the colors as per #RGB, #ARGB, #RRGGBB or #AARRGGBB format
depending on the length of the attribute. All values that begin with '#'
are treated as colors.

Bug: http://b.android.com/73845
Change-Id: I8ad089b821af1e290b9b95771b50213fe2fdd784
(cherry picked from commit 81564dfe60020fa977d39d168f682e9d61825660)
2014-08-26 00:26:56 +00:00
Deepanshu Gupta
0774bc4605 Remove ANDROID_BUILD_TOP from intelliJ path variables.
The variable is not actually needed and it makes working with different
API levels a lot easier since everything now depends on $PROJECT_DIR$.

This change also makes the tests more robust by improving the way it
tries to find the SDK.

Change-Id: I3502ad4a0ba85fd88b497e47964fddb2a89e520c
2014-08-25 15:47:28 -07:00
Adam Lesinski
a5cc002bfe AAPT: Filtering resource fix
Previously, when filtering resources from an APK using
-c option, if one qualifier matched, we would keep the resource.
However, in the case of something like

-c fr-FR,sw360dp

and with a resource in the APK like so

drawable-fr-FR-sw600dp-v13

we would want this resource to be excluded, as it does not
match the sw360dp qualifier (must be less than or equal to it).

This CL fixed the behavior of the filter to require that all
defined qualifier axis be matched.

Bug:17142358
Change-Id: Ie48f3d516a0e610abc7ba8a7ced4eb3ab52534d4
2014-08-22 16:09:54 -07:00
Adam Lesinski
caf797c84a AAPT: Dump installLocation in badging
Bug:17033144
Change-Id: I87dea9af47eef8bcba1465df9b49e355ac6346ec
2014-08-22 13:01:11 -07:00
Adam Lesinski
d255aba093 Merge "Add better error message for AAPT file conflicts" into lmp-dev 2014-08-21 22:00:25 +00:00
Adam Lesinski
27f69f4e06 AAPT: mipmaps should not end up in Splits
Mipmaps are never filtered, and so they will always
end up in the base APK. Make sure they get omitted from
any split.

Change-Id: Id24b082bc9bd2d3f031a58bd0de4d30b4f0de7e0
2014-08-21 13:59:46 -07:00
Adam Lesinski
48f05d29f3 Add better error message for AAPT file conflicts
Some resource directories may be the same even though
their names are different. For instance, the
"smallest width" qualifier was added in API 13,
so the resource directory "values-sw600dp" and
"values-sw600dp-v13" are the same and cause
a conflict. The error reports that this might be the
case.

Change-Id: Ia35f1d670edd48265b3a7fe3d55656128421f612
2014-08-21 20:54:01 +00:00
Adam Lesinski
6a7d2757a9 Use the correct versionCode for Split APKs
Insert the correct versionCode into the generated
Split AndroidManifest.xml.

Change-Id: I0aec797b5a4ff8bd70f9394b18aee5ad292b37c8
2014-08-21 11:00:09 -07:00
Adam Lesinski
6022debdbc AAPT: Fix regression generating dynamic ref table for shared libraries
AAPT stopped generating dynamic reference tables for shared libraries.

Change-Id: Ib0025811bdca1a4756eb21080dd6b6bb3fc1ca3d
2014-08-20 17:55:33 -07:00
Deepanshu Gupta
486ed3da0a Merge "Fix "@null" resource values in LayoutLib." into lmp-dev 2014-08-19 02:43:23 +00:00
Deepanshu Gupta
151b68ddc2 Fix "@null" resource values in LayoutLib.
Bug: http://b.android.com/74072
Change-Id: Ib84906d86772ac3df2407e71ad2167797bec4542
2014-08-19 17:16:48 -07:00
Deepanshu Gupta
92973b8f37 Merge "Add time to status bar and fix wifi icon." into lmp-dev 2014-08-19 21:23:09 +00:00
Deepanshu Gupta
553a4e9138 Add time to status bar and fix wifi icon.
Add vector drawable for wifi icon. Also add time to the status bar.

Change-Id: I01da833087a607e9bb6ff085929e3844990179f8
2014-08-18 16:46:29 -07:00
Adam Lesinski
43a0df04b0 Allow enum generated IDs to reuse existing IDs
Change-Id: Ida5dbbce1c4ecb0a4e57511555cec6448737be25
2014-08-19 03:46:00 +00:00
Adam Lesinski
ad75122440 Include build number in aapt version
Teams are constantly confused over which version of aapt
they are running. Include the build number from the
Android build system in the binary. Can be retrieved by executing
'aapt version'.

Change-Id: I9165c7d01f977344e143c2cb4dd963310ab28b72
2014-08-18 23:42:21 +00:00
Adam Lesinski
9a9a17eb07 Revert "Include build number in aapt version"
This reverts commit a7ce555ee82ed91345a54ee171dc9a415b65e134.

Change-Id: I1018747766963e75bec11ddb01ba6d138f133959
2014-08-18 22:39:38 +00:00
Adam Lesinski
71809ee7f6 Include build number in aapt version
Teams are constantly confused over which version of aapt
they are running. Include the build number from the
Android build system in the binary. Can be retrieved by executing
'aapt version'.

Change-Id: Ie4692fb160c7cbe720a8e76b73e435170214fe0e
2014-08-18 21:08:15 +00:00
Deepanshu Gupta
6e8a98c8b7 am a4ceb9e6: am 32faabbe: Layoutlib: Update wifi and battery icon for KK
* commit 'a4ceb9e64cd1ee6302e41c7799ebb6610af96d0e':
  Layoutlib: Update wifi and battery icon for KK
2014-08-18 18:06:07 +00:00
Adam Lesinski
e47fd12905 AAPT: Output only 64-bit arch when multiArch is true
When android:multiArch="true" in the <application> tag,
aapt dump badging should only output the 64-bit architecture
under the 'native-code' entry.

Other architectures will be emitted under the 'alt-native-code'
entry.

Bug:17061929
Change-Id: I8310b2388b06a2ed571e5e121e4989403082ba68
2014-08-15 22:25:36 -07:00