2657 Commits

Author SHA1 Message Date
Andrii Kulian
8ee7285128 Move rotation tracking to DisplayContent
This CL moves rotation tracking from WindowManagerService to
DisplayContent. This way displays can be rotated independently and
rotation of the main display won't affect rotation of secondary
ones.

Bug: 34242678
Test: android.server.cts.ActivityManagerDisplayTests
Test: testRotationNotAffectingSecondaryScreen
Change-Id: Ic46aaa523482b31ff5ec77f0c2908ceda1156fc0
2017-03-10 18:34:18 -08:00
Jerome Gaillard
afac7771f4 Update Shader delegates following Change Ib5d33a80
Test: layoutlib tests
Change-Id: If0db59dd2400ced9019bb999c014d7d655021fd3
2017-03-10 14:03:05 +00:00
Felipe Leme
640f30a776 Replaced auto-fill by autofill to keep it consistent with API style.
This change will affects 2 types of apps: autofill service implementations
and apps that use autofill APIs.

Since just the former is known to be used at the moment, we're not trying
to keep backward compatibility with the latter.

Bug: 35956626
Test: CtsAutoFillServiceTestCases pass
Test: android.provider.SettingsBackupTest pass

Change-Id: Ia720083508716deae9e887f9faa7ae7c5a82f471
2017-03-09 08:14:49 -08:00
Lei Yu
30d69eaf86 Merge "Add BatterySaverPolicy for power save mode" 2017-03-08 20:02:46 +00:00
jackqdyulei
455e90add2 Add BatterySaverPolicy for power save mode
The BatterySaverPolicy is designed to consolidate all battery saver
knobs into a central location. Usually it is consistent to
mLowPowerModeEnabled unless it gets different data for specific
service. By adding these knobs, we can effectively tune the battery
saver.

This cl sets up the framework for BatterySaverPolicy and updates
following service to get battery saver data from BatterySaverPolicy

1. GnssLocationProvider
2. VibratorService
3. WindowManagerService
4. BackupManagerService
5. SoundTriggerService
6. NetworkPolicyManagerService

Screen brightness will come in a following cl.

Bug: 34693888
Test: FrameworksServicesTests

Change-Id: I6b040e93391614b44d136a485faa4a332c396e51
2017-03-08 09:20:36 -08:00
Jerome Gaillard
80447d42f0 Ignore native color spaces following Change I0164a18f
Test: layoutlib tests
Change-Id: I2fc2f13621524142d00fb86c45e75ecdb250479a
2017-03-08 14:15:51 +00:00
Chad Brubaker
816c83bf03 Enforce visibleToInstantApps for receivers
Instant apps can only send broadcasts to receivers that are declared in
the manifest with android:visibleToInstantApps=true or if the app
registers a receiver at runtime using the new methods that take
visibleToInstantApps.

Bug:33350280
Test: Manually sending broadcasts from Instant Apps only goes to
receivers with visibleToInstantApps set to true.
Test: Receiving a broadcast from within the same app does not require
visibleToInstantApps to be set.

Change-Id: I54d79a502ba9c5fd03ede3c09e08afc88fe2775f
2017-03-07 15:28:03 -08:00
Jerome Gaillard
013edba605 Update layoutlib following Change Ia12d448a
Test: layoutlib tests
Change-Id: I66632bcef3a05d3d89e7fc6a37f099100feed0ad
2017-03-07 12:34:37 +00:00
Charlie Tsai
dea48d61df Implement drawPoint and drawPoints of BaseCanvas_Delegate
Test: Layoutlib tests
Change-Id: Ic6d81b9581db9dab4ecbacb8f08ab41e0077bab0
2017-03-06 11:39:22 +00:00
Charlie Tsai
3f7408fcd9 Merge "Add the test function for rectangle shadow" 2017-03-02 16:51:56 +00:00
Diego Perez
a624099635 Merge "Add perf tests to Main" 2017-03-02 07:42:16 +00:00
David Christie
31a1655191 Create PackageManager.isInstantApp API to query whether
a given package name is an instant app.

Test: refactor existing codepaths retained

Change-Id: I6253fe8cc398d6547566d11043bffd1c4ffaa74a
2017-03-01 16:36:48 -08:00
Charlie Tsai
79062f6fc3 Add the test function for rectangle shadow
Add an XML layout file which contains some buttons
with different elevations to test the shadow generation
algorithm.

Test: Added new rectangle shadow
Change-Id: Ifcb5a48200846c33d89f66c162521f2c8565c95d
2017-03-01 17:56:10 +00:00
Diego Perez
06a7ff3557 Add perf tests to Main
Test: N/A
Change-Id: I907ebdc28043e3ac92bae6b6a19451c2ca24423f
2017-03-01 16:06:59 +00:00
Diego Perez
9a7be3a3eb Rename android.os.Build so it can be dynamically generated
This will allow the android.os.Build class to be generated dynamically
from the Studio side.
In order to allow the "refactoring" of classses like android.os.Build,
Create needed to be modified.

While adding the test, I've also done a small clean-up of the
AsmGeneratorTest to re-use some code.

Bug: http://b.android.com/210345
Test: Added new test to AsmGeneratorTest
Change-Id: Ie4e1209c1c60b7a33cb427dbd556a9741ec8f8b3
2017-03-01 14:21:01 +00:00
Jerome Gaillard
434968aa2f Add stroke width property used by animated vector drawables
This is for example used in displaying a checked radio button.

Test: Modified widget render test to include a checked radio button
Change-Id: I43074ce038f69f28c0cf5fb396d393722b02b142
2017-02-27 14:44:46 +00:00
Jerome Gaillard
88403817a2 Add autofill service to BridgeContext
Test: layoutlib tests
Change-Id: I52b360a64518165eefee4250b1c32e9f5f87845d
2017-02-23 15:15:49 +00:00
Diego Perez
5780637259 Merge "Set MockView.setGravity to public" 2017-02-21 15:20:20 +00:00
Diego Perez
c98c16ded8 Merge "Add support for aapt:attr attributes" 2017-02-21 12:55:14 +00:00
Diego Perez
67ac03043c Set MockView.setGravity to public
The method is used from Studio so it needs to be public.

Test: N/A
Change-Id: I603de9ae0c8b719f5173eff152cc2558f734017e
2017-02-21 10:41:18 +00:00
Diego Perez
bc9d2a13f0 Add support for aapt:attr attributes
Test: Tested from the studio side
Change-Id: Id506801f53cfc976c7352bd7f9632804862668b7
2017-02-21 09:34:49 +00:00
Diego Perez
8f52705b48 Merge "Fix BridgeContext.resolveThemeAttribute color parsing" 2017-02-21 09:30:05 +00:00
Jerome Gaillard
b01d3db742 Merge "Update FontFamily_Delegate following Change I1d6e1c4c" 2017-02-20 11:35:57 +00:00
Diego Perez
3d3e69ce6d Fix BridgeContext.resolveThemeAttribute color parsing
When passed a color, resolveThemeAttribute was not parsing the value
into the .data field.

Bug: http://b.android.com/232870
Test: Added new test
Change-Id: I9d91e3a70c24f1e71d9d89977fe79b0965e98893
2017-02-20 11:08:26 +00:00
TreeHugger Robot
96b9832163 Merge "API for accessing preloaded files cache" 2017-02-17 21:09:28 +00:00
Fyodor Kupolov
61221290f5 API for accessing preloaded files cache
Added @SystemAPI method Context.getPreloadsFileCache.

Bug: 31008665
Test: manual
Change-Id: Id61ab5e1b78d8bfbd40f61985406a8de4082b30f
2017-02-17 10:40:54 -08:00
Jerome Gaillard
1db0d3cd04 Update FontFamily_Delegate following Change I1d6e1c4c
Test: layoutlib tests
Change-Id: I3fda9b0eaf36d74c8a64f2a5c7aeb063b4df8d1a
2017-02-17 15:46:05 +00:00
Andrii Kulian
b047b8bd7e Report move to display for activities that handle config changes
When activity that is moved between displays handles all configuration
changes, it won't be restarted. This CL adds a callback to the client
to notify it about display change. Usually it will be followed by
onConfigurationChanged, except when configuration didn't actually change.
When activity is recreated, it won't receive onMovedToDisplay.

Bug: 34862802
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Change-Id: I9a9501cab788623ada15a31efb53e4b2378639fe
2017-02-16 17:33:59 -08:00
Diego Perez
b9014f356a Merge "Add BridgeXmlPullAttributesTest to the Main suite" 2017-02-16 17:47:10 +00:00
Jerome Gaillard
65febdd300 Merge "Fix LayoutlibTestCallback.getResourceId" 2017-02-16 13:31:38 +00:00
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
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
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