4365 Commits

Author SHA1 Message Date
Robert Carr
0b10c335c7 Ensure we change SurfaceView size from UI thread.
We need to change the SurfaceView size from the UI thread
so that we can appropriately deliver the SurfaceChanged
callback. We also need to not preserve geometry
in this case, as if we don't update the surface
and layout size together we could get scaling. This still has
some potential for holes, as transactions are not synced with
the parent renderer, but we have other methods to avoid
these in the case of resizing. This fixes the remaining
issues with content sizing and surface view "out of sync".

Bug: 27780983
Bug: 27687126
Bug: 27676101

Change-Id: Idd7864f00e5cf7a4eb32dd66c0b389292a788069
2016-03-29 13:42:06 -07:00
Deepanshu Gupta
83b9db029b Merge "Fix menu popup rendering" into nyc-dev 2016-03-28 17:07:13 +00:00
Deepanshu Gupta
97c0679b1a Fix menu popup rendering
Change-Id: I3394866d72af7fd1762ac477529a4a1bc473b7dc
2016-03-28 09:57:24 -07:00
Deepanshu Gupta
3646f5591f Merge "LayoutLib intellij codestyle: line wrap" into nyc-dev 2016-03-25 20:53:15 +00:00
Deepanshu Gupta
3b7abd33f9 Merge "Add tests for getResource*Name()" into nyc-dev 2016-03-25 20:52:52 +00:00
Jungshik Shin
fe952f3a0b Merge "Add Lang-to-Script entries for languages with new hyph patterns" into nyc-dev 2016-03-25 00:30:45 +00:00
Deepanshu Gupta
60dc3a9917 LayoutLib intellij codestyle: line wrap
Force line wrap (do not exceed right margin) and allow shorter lines to
merge.

Change-Id: I06f3689bff710c8dec023edb842595eacd745c17
2016-03-24 14:27:27 -07:00
Deepanshu Gupta
ceb1ab1d2a Add tests for getResource*Name()
Change-Id: I02170b2b68c76f817aa0771a5333abf2aee456c0
2016-03-24 14:27:21 -07:00
Deepanshu Gupta
618ca261f3 Support getResource*Name() methods for Resources
The following methods are now supported:
getResourceEntryName
getResourcePackageName
getResourceTypeName
getResourceName

Bug: http://b.android.com/181872
Change-Id: If06b5e0687ab6f8cb20ab77f339870dd08a84ce1
2016-03-24 12:02:17 -07:00
Clara Bayarri
3e5bf786b7 Merge "Keyboard Shortcuts: plumb deviceId through" into nyc-dev 2016-03-24 13:30:48 +00:00
Clara Bayarri
fcd7e80b21 Keyboard Shortcuts: plumb deviceId through
Bug: 27673736
Change-Id: Ie72807aa8c2bfd142b081a6a915e101c16d31473
2016-03-24 11:47:32 +00:00
Deepanshu Gupta
3e2b413dc7 Merge "Exclude java namespace classes from layoutlib" into nyc-dev 2016-03-23 20:48:15 +00:00
Deepanshu Gupta
fa5f55fe90 Exclude java namespace classes from layoutlib
Such classes can't be loaded anyway. No point including them

Change-Id: I26934014de96aa59f0d4aef59f61d1e4f71b86ea
2016-03-23 12:39:27 -07:00
Diego Perez
f0fce3e9ce Merge "Add fill type support to vector drawable" into nyc-dev 2016-03-23 18:45:29 +00:00
Jungshik Shin
6c4f9e0d6f Add Lang-to-Script entries for languages with new hyph patterns
Hyphenation patterns are being added for 22 languages and they need
entries in LANG_TO_SCRIPT

This CL is a prerequisite to the following CL to add hyphenation
patterns for more languages:

https://googleplex-android-review.googlesource.com/#/c/890133/

BUG: 26405413
Change-Id: Ibba8379cca29a5a7b6df35f10b66468b612601f8
2016-03-23 17:19:49 +00:00
Diego Perez
5ceb30f216 Add fill type support to vector drawable
The platform has added fill type to vector drawables. This CL implements
the native replacement.
Also remove a couple of delegates for classes that have been removed
from the platform.

Change-Id: Ie6ba344db9c9c2c45cd0ef4b99f11f9d8bcfd7de
2016-03-23 09:40:23 +00:00
Siyamed Sinir
c56ad2badb Temporarily disable emoji availability check
On builds where SMALLER_FONT_FOOTPRINT environment variable is set, some
of the fonts are not included in the build which causes emoji checks to
fail. This CL temporarily disables emoji checks.

Bug: 27785690
Change-Id: Ie32f0aa630c84347588fc87630467c14e985940a
2016-03-22 17:50:58 -07:00
Chong Zhang
3db51d1999 Merge "Don't change geometry in relayout if preserve geometry is requested" into nyc-dev 2016-03-22 18:05:33 +00:00
Diego Perez
21412f09b9 Merge "Remove BufferedImage allocation from PorterDuff filter" into mnc-ub-dev
am: ebf3261

* commit 'ebf3261aa6d80ad4ca1df0fd0509961ff7a1914e':
  Remove BufferedImage allocation from PorterDuff filter
2016-03-22 17:40:20 +00:00
Diego Perez
ebf3261aa6 Merge "Remove BufferedImage allocation from PorterDuff filter" into mnc-ub-dev 2016-03-22 17:33:05 +00:00
Chong Zhang
6136273888 Don't change geometry in relayout if preserve geometry is requested
This causes scaling to be applied in the relayout window since the
requested size won't match the window size. Apply the requested size
in repositionChild instead.

bug: 27676101
Change-Id: I03beee2b9fe118a6be329b5fd1338d54e48d9a22
2016-03-22 10:28:27 -07:00
Deepanshu Gupta
a96d258fdf Merge "Add guard around getXmlFileParser() call" into nyc-dev 2016-03-21 22:45:14 +00:00
Deepanshu Gupta
cd6e47e445 Add guard around getXmlFileParser() call
Prevents the need to update the LayoutLib API level.

Bug: http://b.android.com/202942
Change-Id: I507239148ab8d6d45406624dba569c8b7197f979
2016-03-21 14:07:20 -07:00
Deepanshu Gupta
86621737fc Merge "Add guard around getXmlFileParser() call" into mnc-ub-dev 2016-03-21 18:53:57 +00:00
Matt Sarett
d126b1ed5d Merge "Work-around paletted image decoding bug in SDK_JELLYBEAN" into nyc-dev 2016-03-21 18:26:19 +00:00
Deepanshu Gupta
13d2e2e10b Add guard around getXmlFileParser() call
Prevents the need to update the LayoutLib API level.

Bug: http://b.android.com/202942
Change-Id: I507239148ab8d6d45406624dba569c8b7197f979
2016-03-21 08:53:13 -07:00
Diego Perez
38735b0026 Merge "Account for parent scroll position" into nyc-dev 2016-03-21 11:20:14 +00:00
Yohei Yukawa
1064d35307 Merge "Tell IMS about missing InputConnection methods." into nyc-dev 2016-03-19 00:36:22 +00:00
Tony Mantler
4f29d45ad4 Merge "Fix build" into nyc-dev 2016-03-18 21:20:49 +00:00
Tony Mantler
86b66c5ef6 Fix build
Change-Id: I590db57366a40aa011ee02e6e34e64cd2e7d1115
2016-03-18 13:06:56 -07:00
Diego Perez
d15459197f Account for parent scroll position
When calculating the ViewInfo bounding box, account for the parent
scroll position.
Also make renderAndVerify return a RenderResult to verify some data
about the result layout.

Change-Id: I965e393c49b5030c80083daf5e058fa31400ce93
2016-03-18 16:52:39 +00:00
Roozbeh Pournader
1169f65234 Merge "Add more emoji-related tests" into nyc-dev 2016-03-17 22:18:51 +00:00
Jeff Sharkey
8a372a0a28 Refactoring FBE APIs based on council feedback.
Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
2016-03-17 14:49:08 -06:00
Roozbeh Pournader
7b822e5fc1 Add more emoji-related tests
1. Check that dual-use text/emoji character that default to text
style are available in a font before the emoji font. (Exceptions are
Unicode 7.0 characters that Noto Symbols doesn't support yet and four
odd characters that should be added to the Noto Symbols subset.)

2. Remove previous workaround for default emoji-style characters that
were in the Noto CJK fonts, since they are now subsetted out from
Noto CJK.

Bug: 26113320
Bug: 26187231
Change-Id: Ib9ea2f4f7e6ca0cd8d291f1dc3d7ee5053d4928e
2016-03-17 08:50:43 -07:00
Benjamin Franz
f9124ecad9 Merge "Flush package restriction changes for a user." into nyc-dev 2016-03-16 23:51:44 +00:00
Matt Sarett
48efde4fb1 Work-around paletted image decoding bug in SDK_JELLYBEAN
Because there is a bug decoding paletted images in SDK_JELLYBEAN,
we need to avoid encoding paletted images for apps that support
SDK_JELLYBEAN and earlier.

BUG=27643907

Change-Id: Ib7d51ed87435cd36507915d62b0057c06f18b2b6
2016-03-16 18:36:06 -04:00
Roozbeh Pournader
fa1facc0fd Add emoji-related tests for the font chain
1. Check that all emoji characters are supported in emoji fonts.

2. Check that no default-emoji characters are included in any font
that can get a higher score then the color emoji font, either by
being before it or by having a language/script assigned.

Bug: 26187231

Change-Id: Ic76bf59f1c6f9d2d290b1b64128d725ae08dcb5c
2016-03-16 13:57:22 -07:00
Sudheer Shanka
bbb3ff2b2a Flush package restriction changes for a user.
Change-Id: I7c4481f820b6b368487d00de6c783e64cec99f4b
2016-03-16 01:42:23 +00:00
Yohei Yukawa
19a80a1e80 Tell IMS about missing InputConnection methods.
Summary:
  This CL introduces a unified mechanism to deal with the situation
  where the application directly implements InputConnection but some of
  methods are not implemented.  Note that there should be zero overhead
  when the application extends BaseInputConnection or
  InputConnectionWrapper.

Background:
  When ever we add a new method to InputConnection, there has been a
  risk that existing applications that directly implement
  InputConnection can get java.lang.AbstractMethodError exception at
  runtime, because older SDKs do not require the application developer
  to implement the methods that are newly added in later SDKs.  Because
  of this we strongly discouraged developers to directly implement
  InputConnection interface, and encouraged them to subclass
  BaseInputConnection or InputConnectionWrapper instead.  That said, as
  requested in Bug 26945674, there is a certain demand to be able to
  implement InputConnection without depending on BaseInputConnection.
  The goal of this CL is to provide a reliable and sustainable solution
  to above missing method scenario in InputConnection.

  One of the reasons why dealing with missing InputConnection methods is
  so difficult is that what InputMethodService receives to communicate
  with the target application is actually a proxy class
    com.android.internal.view.InputConnectionWrapper
  that runs in the IME process and immediately returns true for most of
  methods in InputConnection such as #commitText() and
  #finishComposingText().  Because of this asynchronous nature, it is
  too late to change the actual return value that the IME receives when
  the application receives those one-way asynchronous IPC calls.

Solution:
  To handle those cases, this CL checks the availability of
  InputConnection methods that did not exist in the initial release
  before the target application calls startInput(), and let the
  application to send its availability bits to IMMS so that
  InputConnectionWrapper running in the IME process can be initialized
  with such availability bits.  Note that we do know that
  BaseInputConnection and its subclasses support all the InputConnection
  methods, hence for most of applications we can just assume that all
  the methods are available without reflection.

  With such availability bits, InputConnectionWrapper is now able to
  gracefully return failure code to the IME because the availability of
  those methods is immutable, except for a tricky case where the
  application relies on a proxy object that dynamically changes the
  dispatch target.

  Here is the list of APIs that we start checking the availability in
  this CL.
    [API Level 9+]
     - InputConnection#getSelectedText(int)
     - InputConnection#setComposingRegion(int, int)
    [API Level 11+]
     - InputConnection#commitCorrection(CorrectionInfo)
    [API Level 21+]
     - InputConnection#requestCursorUpdates(int)}
    [API Level 24+]
     - InputConnection#deleteSurroundingTextInCodePoints(int, int)
     - InputConnection#getHandler()

Ideas alternatively considered: Default methods in InputConnection
  We once considered having default methods in InputConnection but
  abandoned this idea because it does not directly solve the problem
  about how to tell the that the API does not take effect.
  Also having default methods would make it difficult for application
  developers to be aware of newly added methods in InputConnection.

Bug: 27407234
Bug: 27642734
Bug: 27650039
Change-Id: I3c58fadd924fad72cb984f0c23d3099fd0295c64
2016-03-15 06:43:39 +00:00
Adrian Roos
7400f82699 Merge "Don't show wallpaper when backdrop is visible" into nyc-dev 2016-03-15 03:26:02 +00:00
Adrian Roos
d5c2db630f Don't show wallpaper when backdrop is visible
Hides the wallpaper when it's not needed and fixes
the unlock animation to not unnecessairly show the
wallpaper if neither the Keyguard nor the underlying
app need it.

Also fixes a bug where the enter animation had a background
set, which led to uglyness when no wallpaper is involved.

Bug: 27533740
Change-Id: I667c6f7ca6c0e1ff7e9f793c6ddc13f6da8387b1
2016-03-14 18:55:41 -07:00
Diego Perez
adf62b3ebc Do not deallocate on Bitmap.recycle
Layoutlib only disposes the bitmap and doesn't recycle them. This causes
a double deallocation that triggers an assertion.
This change makes Bitmaps to be only freed when the finalizer is called.

Bug: http://b.android.com/203129
Change-Id: Ieabc1443544cfd2b4bf8ba9c8f9a4df8dd6e8220
2016-03-14 09:31:07 +00:00
Adam Lesinski
52db414176 Merge "AAPT2: statically link protobuf library" into nyc-dev 2016-03-11 21:33:34 +00:00
Roozbeh Pournader
e3dedf9f44 Merge "Add test script for sanity of font fallback chain" into nyc-dev 2016-03-11 20:36:01 +00:00
Jorim Jaggi
95b69f8231 Merge "Add ability to swap docked/fullscreen stack" into nyc-dev 2016-03-11 12:02:38 +00:00
Adam Lesinski
330c57dbd1 Merge "AAPT2: Add descriptions of Attributes in Styleables for R.java" into nyc-dev 2016-03-11 09:16:44 +00:00
Adam Lesinski
7656554f91 AAPT2: Add descriptions of Attributes in Styleables for R.java
Change-Id: I69e7b73cbdfe4baf502348397435c501ae29ff5e
2016-03-11 00:22:52 -08:00
Adam Lesinski
f4ab612684 AAPT2: statically link protobuf library
Change-Id: I0bce42dfef2f11181c6407839875c97f88445dbd
2016-03-11 07:20:49 +00:00
Roozbeh Pournader
0e969e2c0b Add test script for sanity of font fallback chain
Various tests have been added:

1. Availability of hyphens: Make sure that every font used for
rendering a language that is automatically hyphenated includes either
of Unicode hyphen characters U+2010 HYPHEN or U+002D HYPHEN-MINUS.

2. Range of values: Make sure that styles, weights, and styles belong
to certain limited sets.

Bug: 26187231
Bug: 21570828
Bug: 21815394
Change-Id: Ia63d63cc8da4f2d6bc81fe5619ccac6cfcd9a54e
2016-03-10 18:07:15 -08:00
Jorim Jaggi
d47e7e1176 Add ability to swap docked/fullscreen stack
Adds tap affordance that moves all tasks of the docked
stack into the fullscreen stack as well as moves the top task
of the fullscreen stack into the docked stack.

Also make sure not to trigger focus switch when tapping the divider
handle. For that, add a method so SysUI can specify the touchable
region which then gets excludes for the focus switch touch region.

Bug: 27358134
Change-Id: I34f39c53cacc0b9c00f87a792b88c3f64a5f61e1
2016-03-10 19:49:45 +01:00