2290 Commits

Author SHA1 Message Date
Deepanshu Gupta
97c0679b1a Fix menu popup rendering
Change-Id: I3394866d72af7fd1762ac477529a4a1bc473b7dc
2016-03-28 09:57:24 -07: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
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
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
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
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
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
Benjamin Franz
f9124ecad9 Merge "Flush package restriction changes for a user." into nyc-dev 2016-03-16 23:51:44 +00: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
Jorim Jaggi
95b69f8231 Merge "Add ability to swap docked/fullscreen stack" into nyc-dev 2016-03-11 12:02:38 +00: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
Diego Perez
f2af68312b Merge "DO NOT MERGE: Initialize layoutlib variables before using them" into mnc-ub-dev 2016-03-10 16:06:41 +00:00
Siva Velusamy
f1c6e0bd7b BridgeContext: Fix typo in attr name (toLeft -> toLeftOf)
am: af0f3bda17

* commit 'af0f3bda17ee3de4ad3560c9a675527b20e2af5f':
  BridgeContext: Fix typo in attr name (toLeft -> toLeftOf)
2016-03-08 13:58:52 +00:00
Siva Velusamy
af0f3bda17 BridgeContext: Fix typo in attr name (toLeft -> toLeftOf)
Change-Id: I214ddf066bd69d56275477712419745cf781cee3
2016-03-08 13:52:02 +00:00
Diego Perez
39b205cc92 Add missing references to VNativeObject
Change-Id: I2db4ad94009c0daff4649da6f85e5c084f4c01ea
2016-03-07 22:12:01 +00:00
Xavier Ducrohet
7ba6dc0fcc Merge "Change BridgeResources to Resources_Delegate" into nyc-dev 2016-03-07 20:28:14 +00:00
Xavier Ducrohet
5b5b1c0c5d Merge "Animated vector drawable support" into nyc-dev 2016-03-07 20:26:56 +00:00
Diego Perez
2591346546 DO NOT MERGE: Initialize layoutlib variables before using them
Change-Id: I0d2059423b46f5eb9eb50eb226cbe9a15e57fe02
2016-03-07 15:00:10 +00:00
Diego Perez
566b303365 Add support for GradientColor in layoutlib
Change-Id: Ia9a55a9e00d7ddb5263f3dbe46b5da8dde457526
2016-03-07 09:11:11 +00:00
Deepanshu Gupta
e05f1c4684 Change BridgeResources to Resources_Delegate
This is a very hacky fix to make layoutlib work with the latest support
lib. Inject a couple of fields in android.content.res.Resources to
allow using most of the earlier code as is.

Bug: 27403642
Bug: http://b.android.com/201934
Change-Id: Ia96a1b4642a1907a77d9ca7a2392f78809b92e38
2016-03-07 09:09:02 +00:00
Deepanshu Gupta
9b137e27d3 Change BridgeResources to Resources_Delegate [DO NOT MERGE]
Do not merge because the resource implementation has changed in N and
the change is no longer valid there.

This is a very hacky fix to make layoutlib work with the latest support
lib. Inject a couple of fields in android.content.res.Resources to
allow using most of the earlier code as is.

Bug: 27403642
Bug: http://b.android.com/201934
Change-Id: I186cad32b1b4de64164fbad937d989e0110c6976
2016-03-04 20:18:23 +05:30
Wale Ogunwale
8d5a542f66 Clear app token mAppStopped when app resumes.
It is possible for an activity to be in the stopped state without
setting it's visiblility to false in window manager.
For example, the home acitivty behind the lock screen. Since the
lock screen isn't an activity it doesn't affect the visiblity set
of the home activity, so AM doesn't tell WM to hide the app token.
However, AM uses another channel to detect that the device is locked
and moves the activity into stopped state. WM on the other hand also
detects that the device is locked and hides the window surfaces of
all windows behind the lock screen. So, at this point AM has also
told WM that the activity is stopped. Once you unlock the screen
AM resumes the activity but doesn't report any visiblility changes to WM
since it's internal state didn't change. So, if you go from the home
activity to another app the home activity window will be destroyed
before the activity is stopped because mAppStopped is set to true.
We now set mAppStopped to false when the activity is resumed.

Bug: 27286867
Change-Id: Ic75456d30abd582fa44f932f5aeeb449950157ee
2016-03-03 18:59:26 -08:00
Diego Perez
1b338cda4e Add missing translate if the drawable top is not 0,0
If the vector drawable coordinates are not 0,0 we need to translate the
canvas to that position.

Change-Id: I3a829c427ec98061da3295e3cba8655f693d390c
2016-03-03 15:06:46 +00:00
Diego Perez
8a9a824cd5 Animated vector drawable support
Change-Id: Iefd41d95503bb4f3b26020a519636a63d3da799b
2016-03-03 12:57:16 +00:00
Diego Perez
a38b7c180d Merge "Implement native methods in VectorDrawable" into nyc-dev 2016-03-03 09:55:05 +00:00
Neil Fuller
44be5f0ed7 Merge "Change libraries needed by layoutlib to "host" libs" into nyc-dev 2016-03-03 09:11:09 +00:00
Vadim Tryshev
c9f0a1103e Merge "Adding getManagedUserBadgedDrawableForDensity() to PackageManager." into nyc-dev 2016-03-03 00:28:17 +00:00
Vadim Tryshev
66ae66a7f7 Adding getManagedUserBadgedDrawableForDensity() to PackageManager.
It allows badging an image regardless of of the user (no
user id parameter). The styling for managed users is applied.

This is useful for new cases where the existing functions
wouldn't badge the icon, but we need it.

Bug: 25192539
Change-Id: I2fd2f226f626fb2e6cda1cfe072013350e12b41c
2016-03-02 14:55:04 -08:00
Deepanshu Gupta
1aeb31bdbb Merge "Add StubMethodAdapterTest" into nyc-dev 2016-03-02 13:32:18 +00:00
Deepanshu Gupta
a9de835c17 Add StubMethodAdapterTest
This tests the bugfix in StubMethodAdapter made in the change with id
I098996e43e330e995d33f12df1c16355bbc02f0f (commit 491523d)

Change-Id: I1ac897a49071dd9558bdc6b8abec29df913a6047
2016-03-02 13:30:31 +00:00
Deepanshu Gupta
dbe8a0fe3b LayoutLib: Reference android's junit in intellij project.
Prevents errors due to mismatch in junit version.

Change-Id: I2adf32efb16472aa5f5e51025b6bb75afc76a8b4
2016-03-02 13:26:18 +00:00
Neil Fuller
d34e33bc83 Change libraries needed by layoutlib to "host" libs
They are only used on host and are one of the few places
in the build that use LOCAL_JACK_ENABLED := disabled.

Bug: 27218410
Change-Id: Ida6e649ad33decc743e8190a86486e7c4f8e5c88
2016-03-02 11:40:44 +00:00
Diego Perez
5d1013cf13 Implement native methods in VectorDrawable
Most of the VectorDrawable implementation has been moved to native code.
This CL implements most of the required functionality that existed in
Marshmallow.

Change-Id: I009bcd5c166f2bfa0795d2718fabab4a549eba9f
2016-03-02 09:03:03 +00:00
Diego Perez
e6423ee0ed Merge "Fix layoutlib expand unit test" into nyc-dev 2016-03-02 08:57:26 +00:00
Todd Kennedy
a67932374d Revert "Revert "Remove deprecated methods / classes""
This reverts commit 5cbeb5902633646fbc0a1be252081e77aaaee7b4.

Change-Id: Id96010364d65e6131221ebbcc8ce5889a2da256c
2016-03-01 07:19:33 -08:00