5375 Commits

Author SHA1 Message Date
Tyler Gunn
79bc1ec8a9 Add handover permission, fill in some missing API gaps.
Adding the ACCEPT_HANDOVER runtime permission which an app must have in
order to accept handovers (this is per design).

Adding missing onHandoverComplete method in the android.telecom.Connection
API (per design).

Finishing plumbing for android.telecom.Call#onHandoverComplete API.

Fix issue where the new handover API methods would never get called; the
legacy handover extra was being used in this case when it should not have
been.

Bug: 65415068
Test: Verified using new CTS tests
Change-Id: If1558f6a23911862c02ac5b18fb62d86911ed7e2
2018-01-24 16:11:27 -08:00
Evan Rosky
c41adfac71 Merge "Expose selector draw condition for test" 2018-01-25 00:08:03 +00:00
Makoto Onuki
8e49825e80 Propagate location mode properly from SettingsProvider
Bug: 72240163
Bug: 72037769
Test: atest $ANDROID_BUILD_TOP/cts/tests/tests/batterysaving/src/android/os/cts/batterysaving/BatterySaverLocationTest.java

Change-Id: I7bad1547aaad30aa5c47ef813cbfc14dad4a5cce
2018-01-23 11:54:51 -08:00
Evan Rosky
8e5bd81c56 Expose selector draw condition for test
There is no other way for a test to inspect whether the
selector drawable will be drawn or not. This adds a hidden
test api to expose it

Bug: 67881712
Test: AbsListViewTest#testSelectorOnScreen
Change-Id: I3b6d25a0c8cb0c5f6c8bfc45eaa2660caa133b7d
2018-01-22 09:36:41 -08:00
Doris Liu
25be4e0461 Merge "Expose some hidden APIs in Choreographer to CTS" 2018-01-18 23:38:49 +00:00
Felipe Leme
db6b0fecb4 Merge "Moved Field Classification score logic to ExtServices." 2018-01-18 23:33:44 +00:00
Felipe Leme
bc055b0ef1 Moved Field Classification score logic to ExtServices.
Bug: 70939974
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest \
            CtsAutoFillServiceTestCases:UserDataTest
Test: atest CtsAutoFillServiceTestCases

Change-Id: I75fd59b5d7530fcd7095b26f6e592d7459c7d235
2018-01-18 10:40:30 -08:00
Kenny Guy
05ce809b82 Add more brightness config details to dumpsys
Allow client to add a description to a brightness
config and dump to dumpsys
Dump time and package name of system app that
set the last brightness config.

Bug: 71854421
Test: atest PersistentDataStoreTest
Test: manaual - check adb shell dumpsys display
Change-Id: I5ff0c0d3a4c5e30c9d4aa7eea850c7174ee20450
2018-01-17 20:42:42 +00:00
Doris Liu
4f8a98cb26 Expose some hidden APIs in Choreographer to CTS
BUG: 62066083
Test: make CtsViewTestCases
Change-Id: I577211e476119ea78ba63aff69987794e8b31a69
2018-01-16 18:22:12 -08:00
TreeHugger Robot
30b8dd4199 Merge "Tag brightness APIs with @SystemAPI" 2018-01-15 18:31:34 +00:00
TreeHugger Robot
82548f4bc3 Merge "Implement DISALLOW_SHARE_INTO_MANAGED_PROFILE" 2018-01-13 16:40:41 +00:00
Rubin Xu
cc391c2c13 Implement DISALLOW_SHARE_INTO_MANAGED_PROFILE
Add a user restriction to allow profile owners to enforce a stronger
isolation of managed profile by preventing users sharing data into
the profile. This is achieved by disabling a subset of built-in cross
profile intent filters added by ManagedProvisioning during profile
inflation.

Implementation wise, DevicePolicyManagerService listens for the restriction
change and notifies ManagedProvisioning to modify the built-in intent
filters. This is needed since ManagedProvisioning has ground truth of all
built-in intent filters and manages them. It also has the advantage that
ManagedProvisioning only needs to run when a policy change happens.

Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testDisallowSharingIntoProfileFromPersonal
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testDisallowSharingIntoProfileFromProfile
Bug: 63911046
Change-Id: Ia6d12a5086627d1280325cd19d6e3a0752dae633
2018-01-12 19:01:40 +00:00
Makoto Onuki
f9046a2093 Expose Global.LOW_POWER_MODE for CTS
Bug: 68769804
Test: atest CtsBatterySavingTestCases
Change-Id: I7dfac2e0c549c91cd368ca955fff71e15d585b34
2018-01-12 10:33:51 -08:00
Kenny Guy
0ff4489cc5 Tag brightness APIs with @SystemAPI
Make the API for tracking brightness
slider events and setting brightness
curves @SystemAPI and @TestAPI
Add developement scope to the brightness
slider events permission to allow cts
testing.

Bug: 69405990
Test: atest android.permission2.cts.PermissionPolicyTest#testPlatformPermissionPolicyUnaltered
Test: atest BrightnessTrackerTest
Change-Id: I39b0b26454528425b62cf99dc8bbccded4e14a18
2018-01-10 18:27:34 +00:00
Peter Visontay
b97fbc8c5f Mark AppOpsManager.setMode() @TestApi.
There's a CTS test that accesses this via reflection, which we want to fix: AppOpsTest.testSetMode().

Test: make CtsPermissionTestCases -j32 && cts-tradefed run singleCommand cts-dev -m CtsPermissionTestCases --test android.permission.cts.AppOpsTest
Change-Id: I8e62d55271caaa730c4233f761145f90cc34111c
Bug: 71626306
2018-01-05 15:09:01 +00:00
Peter Visontay
5a2a1ef74a Define a @SystemApi string ID for each App Op.
Internal numeric op codes may change, but the public string IDs must consistently refer to the same operation.

Bug: 63907873
Test: Ran the tests being added in this this topic: make CtsPermissionTestCases -j32 && cts-tradefed run singleCommand cts-dev -m CtsPermissionTestCases --test android.permission.cts.AppOpsTest
Change-Id: I12bd9e2384d938120a403c4d76be4c1479ffd4ee
2018-01-05 13:09:01 +00:00
Jeff Sharkey
8eb783b21e FBE devices now fully support adoptable storage.
We've finished all the underlying work to support adoptable storage
on FBE devices, so remove the code that was disabling it by default.

Introduce feature flag to make it easier to detect devices that
support adoptable storage.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 29923055, 25861755, 33252673, 37289651
Change-Id: I3630d690c9e66c7e41e316a4263ea2eb1e752ad3
2018-01-04 18:50:14 -07:00
TreeHugger Robot
3157acc318 Merge "Default grant coarse loc perm to use-open-wifi app" 2018-01-04 20:24:39 +00:00
TreeHugger Robot
1e8a6d36bc Merge "Refactored Field Classification score logic so it can be moved to ExtServices." 2018-01-04 19:00:40 +00:00
Eric Enslen
1e423b950a Default grant coarse loc perm to use-open-wifi app
Bug: 70843697
Test: flashed onto walleye and confirmed permission granted when WFA is
enabled.

Change-Id: Ic53886478ec6b8bef311f2f94e0976f7870c8cd1
2018-01-04 10:43:46 -08:00
Felipe Leme
27f4573d13 Refactored Field Classification score logic so it can be moved to ExtServices.
Bug: 70939974
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest \
            CtsAutoFillServiceTestCases:UserDataTest
Test: atest CtsAutoFillServiceTestCases

Change-Id: If584ab3a55744a62f427065bfd44c8c219df83e9
2018-01-03 09:27:51 -08:00
Wyatt Riley
8134c9040e Merge "Providing GNSS Model Name & Year" 2017-12-22 17:05:23 +00:00
Wyatt Riley
d87cf91762 Providing GNSS Model Name & Year
GNSS Model Year moves from a TestApi to public
GNSS Model Name is connected from a new .hal to public

Bug: 38003769
Test: Builds, works with CTS & Test App on Pixel 2
Change-Id: I3e0a56c60e1a4d298e120df11ffd37b06ecea050
2017-12-21 13:07:03 -08:00
TreeHugger Robot
1034bf17fa Merge "Add TestApi to disable the TextClock clock tick." 2017-12-21 19:23:41 +00:00
TreeHugger Robot
0ce51f60b4 Merge "Added @TestApi on new Autofill settings for field classification." 2017-12-21 17:12:12 +00:00
Naomi Musgrave
db980f4a3c Add id to SecurityEvent.
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/SecurityEventTest.java
Bug: 63910201
Change-Id: I053ec9d6c8281d637ace5dc89057e5f7b5ad6554
2017-12-21 15:34:11 +00:00
Paul Duffin
9f6282d0ab Remove android.test.mock classes from android.jar
This removes all android.test.mock from the main android.jar.

This change is being done now rather than wait until they can all be
removed together because the code base is a moving target. Doing this
change minimizes the window during which other developers could either
revert the previous changes that make this possible or add new code that
relies on the android.test.mock classes being in android.jar and so
would require yet more changes.

Bug: 30188076
Test: make checkbuild
Change-Id: I3d31e4528c99e2e297aaec9c4b657bdd305bd464
2017-12-21 10:58:35 +00:00
Felipe Leme
bbfed90230 Added @TestApi on new Autofill settings for field classification.
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest CtsAutoFillServiceTestCases:UserDataTest

Bug: 70407264

Change-Id: Ia4413e5aa8973bafa0149093c6c17602dd498ae5
2017-12-20 16:16:45 -08:00
George Mount
1c9b3136f7 Add TestApi to disable the TextClock clock tick.
Bug: 70771205

In order to test TextClock being only updated by the 12/24
hour setting, we must disable the clock tick from causing
the text to change. Otherwise whenever the minute changes,
the clock text would update. This leads to a flaky test.

Test: I4917a2296744697f1b50a17e3c5eb5873d567a47
Change-Id: Ifb669af3e6b882eb7c158b7de16e7eb2f0c48f61
2017-12-20 13:54:39 -08:00
Benedict Wong
ebf59a8962 Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" am: d0ac50bcad am: 8caa274ade
am: 9de5c77303

Change-Id: I4140f386687c579044f9b5fe59dd7e05f86000fe
2017-12-19 00:41:55 +00:00
Benedict Wong
babe5d7364 [ipsec-qtaguid] Tag sockets upon creation of encap sockets
Added calls to tag encap sockets to that of the UID for which the encap
socket is being created on behalf of. This ensures that all data
accounting generated for the UDP-encap-ESP socket is correctly billed to
the right UID.

Bug: 62994731
Test: New tests added to IpSecServiceTest.java, passing
Change-Id: I15365ea9c982fd7b4e3cdeff314ddfba2289c86e
2017-12-18 19:46:06 +00:00
Felipe Leme
78172e70f4 Made Autofill Field Classification API public and documented it.
Test: mmm frameworks/base/:doc-comment-check-docs
Test: atest FrameworksCoreTests:SettingsBackupTest
Test: m -j 100 update-api

Fixes: 67867469

Change-Id: Iedf56a2bbcde3826eb22f5ed7a96d6ed70b968f4
2017-12-14 19:48:26 -08:00
Jeff Sharkey
28c660f11a API that reports first SDK level of the device.
This is different from SDK_INT, which can change due to OTA
software updates.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.BuildTest
Bug: 69270887
Change-Id: Ic3f4b22b25dc08f3fbdbdf7622c953323447ea01
2017-12-12 14:11:14 -07:00
Jiyong Park
2f24f039c3 PROTECTION_FLAG_VENDOR_PRIVILEGED as @TestApi
The flag is used in CTS.

Bug: 70332172
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
-t
android.permission2.cts.PermissionPolicyTest#testPlatformPermissionPolicyUnaltered

Change-Id: Iba4ce1475991249980cc6a403037f4dd7bf722e5
2017-12-08 12:25:25 +09:00
Jeff Sharkey
bc4f48b21d Emit all APIs using Predicates.
Generate APIs using updated doclava.

Test: manual inspection of API text files
Bug: 69505783
Change-Id: I2efd22998a64ebb57588b073c4a591242f4aef91
Merged-In: I2efd22998a64ebb57588b073c4a591242f4aef91
2017-12-06 21:56:12 -07:00
Felipe Leme
329d04097e Moar changes for Autofill Field Classification mechanism:
- Changed max score to float (range 0.0 - 1.0).
- Replaced getTopMatch() to getMatches().
- Created a Scorer interface with a default edit-distance implementation.
- Added a isFieldClassificationEnabled() method.

Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest
Test: atest CtsAutoFillServiceTestCases:EditDistanceScorerTest
Test: atest CtsAutoFillServiceTestCases:UserDataTest
Test: atest FrameworksCoreTests:SettingsBackupTest

Bug: 68045531

Change-Id: Ice6cbf548053b86b47980d9664a3a21219c0ff08
2017-12-06 13:14:15 -08:00
Felipe Leme
bb6bfea680 Refactored the FieldsClassification score mechanism.
Before, FillEvent.getFieldsClassification() returned a map of remote ids and
scores. Now, it returns a Map of FieldClassication by AutofillId, which allows
multiple fields and scores for multiple user datas (although the initial
implementation supports only the top match for a field).

This is mostly a refactoring CL, as the implementation is still saving just one
user data entry and one field. But full support is coming next...

Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest
Test: atest CtsAutoFillServiceTestCases:UserDataTest
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationScorerTest

Bug: 68045531

Change-Id: I08b29f24efbd527216f9bce2343e1bcd4b4554c0
2017-12-06 11:20:10 -08:00
TreeHugger Robot
57a69f683c Merge "Revert "Don't generate irrelevant a11y events - framework"" 2017-12-06 16:48:16 +00:00
Eugene Susla
d4128ec0df Revert "Don't generate irrelevant a11y events - framework"
This reverts commit 8ddfb4794f128ad6ac10fed72c73fdec61ea7bcb.

Test: presubmit
Bug: 69975306
Change-Id: I05cb545eb0adc77298dddf2dea2997ef36b58a5f
2017-12-05 13:08:51 -08:00
Hall Liu
c823b876c1 Merge "Un-hide Connection-side RTT APIs for Dialer" 2017-12-05 19:40:14 +00:00
Wale Ogunwale
36f46a8731 Merge "Don't send userLeaving hint when entering split-screen mode." 2017-12-05 00:21:20 +00:00
Hall Liu
37dfdb0c24 Un-hide Connection-side RTT APIs for Dialer
Bug: 63934808
Test: builds
Change-Id: I59a892fb0e314810e92dd9ad7d0c2f4610055045
2017-12-04 14:19:30 -08:00
Felipe Leme
452886a5b8 Refactored field detection mechanism to support multiple fields.
Now instead of using FillResponse.setFieldDetection() with an object that
contains both the autofill ids an the user data, service must:
- Set global mapping through AutofillService.setUserData()
- Pass just the autofill ids to FillResponse.setFieldClassificationIds()

This CL is purely a refactoring CL - although the new API supports multiple
values and multiple fields, the implementation is still hardcode for one
value and one field (as before).

Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest
Test: atest CtsAutoFillServiceTestCases:UserDataTest
Test: atest CtsAutoFillServiceTestCases:FillResponseTest

Bug: 68045531

Change-Id: I8d846d817dfcde3a4db7abff798bb2250e1c4e7b
2017-12-04 09:56:06 -08:00
Wale Ogunwale
c59b4f6f8d Don't send userLeaving hint when entering split-screen mode.
If the current activity stack we are resuming is in multi-window mode
and the last resumed activity stack should still be visible, then don't
send userLeaving hint as the activity will still be visible to the user
after onPause is called.
Also, added option to say if recents activity should be shown when
split-screen is activated. starting the recents activity during
CTS testing can cause timing issues since the recents activity might
be started after the activity we are trying to launch adjacent to
split-screen.

Change-Id: Iba1d0749062e7365a207ba1172705b5ab70cb869
Fixes: 69419620
Test: ActivityManagerSplitScreenTests.testNoUserLeaveHintOnMultiWindowModeChanged
2017-12-04 09:50:55 -08:00
Svet Ganov
8ddfb4794f Don't generate irrelevant a11y events - framework
Now before we fire an a11y event we check if this event has an
observer. As a bonus we don't push the state to clients if the
dynamic service config did not change.

Test: cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases

bug:69427760

Change-Id: Ie208e13b8557bb7a120198a43efcb79c2752f5db
2017-11-28 17:58:38 -08:00
Bryce Lee
f3c6a47bdd Store bounds in WindowConfiguration.
This changelist consolidates the usage of frame bounds in containers
into the WindowConfiguration. As a result, the bounds are now shared
across AM and WM. Any changes to the bounds on one side are
propagated to the other via override configuration changes. Previous
instrumentation to synchronize the two sides is no longer necessary.

This changelist does not attempt to consolidate common logic shared
between WM or AM components for setting bounds.

Bug: 68719294
Test: go/wm-smoke
Change-Id: Ia8978dba8525b83201640e159caefe16e626b7c1
2017-11-27 08:59:19 -08:00
Jeff Sharkey
b8b579e1b8 Emit all APIs using Predicates.
Generate APIs using updated doclava.

Test: manual inspection of API text files
Bug: 69505783
Change-Id: I2efd22998a64ebb57588b073c4a591242f4aef91
2017-11-22 12:34:08 -07:00
Dianne Hackborn
1edf09c99b Merge "Fix issue #67019445: Detect BATTERY_LOW/OKAY" 2017-11-22 18:27:59 +00:00
Eran Messeri
3daba14f25 Merge "DevicePolicyManager: Make installed keys user-selectable by default." 2017-11-22 17:12:29 +00:00
TreeHugger Robot
7430d8d896 Merge "Notify apps when channels/groups are blocked/unblocked" 2017-11-22 15:55:53 +00:00