Commit Graph

15077 Commits

Author SHA1 Message Date
TreeHugger Robot
79c8d6623b Merge "Add API Service.getForegroundServiceType()" 2019-02-28 01:48:02 +00:00
Ralston Da Silva
5bbfa09a94 Merge "Removing usage of unsupportedApi AutoCompleteTextView.ensureImeVisible from SearchDialog Bug: 124452405 Test: No CTS test because SearchDialog is not exposed externally." 2019-02-28 00:45:07 +00:00
Jeff Sharkey
4020f8c038 Merge "Translate SecurityException into EACCES." 2019-02-28 00:19:05 +00:00
Jeff Sharkey
b50f51e604 Translate SecurityException into EACCES.
Gives more consistent experience for code expecting errno values.

Bug: 122092631
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I74f27ae33adca69a563d9d8cfc4cf9bb186e1750
2019-02-27 13:55:42 -07:00
David Brazdil
33bd343596 Move ApplicationInfo to params in AppComponentFactory
Tweak AppComponentFactory.instantiateClassLoader() API to accept
ApplicationInfo as an argument instead of an independent getter.

Bug: 124800390
Bug: 111342996
Test: atest CtsClassLoaderFactoryPathClassLoaderTestCases
Test: atest CtsClassLoaderFactoryInMemoryDexClassLoaderTestCases
Change-Id: I4a4d5af842446a5060083c88a0ac5bec014c0c55
2019-02-27 20:15:18 +00:00
TreeHugger Robot
68463825b6 Merge "Inject long press documentation" 2019-02-27 15:46:43 +00:00
TreeHugger Robot
26ab14c9f5 Merge "Remove the extra CONTENT_CAPTURE_STOP event from Activity.onStop()" 2019-02-27 05:34:23 +00:00
Feng Cao
aaea86b07c Remove the extra CONTENT_CAPTURE_STOP event from Activity.onStop()
(it was accidentally being called twice due to a bad git merge)

Fixes: 125628737
Test: atest CtsContentCaptureServiceTestCases

Change-Id: I260e33942855e7355fd531fb05baf699e9961a89
2019-02-27 03:37:32 +00:00
Rich Cannings
383223ab18 Merge "Refactor passwords/pins/patterns to byte[]" 2019-02-27 03:21:57 +00:00
Varun Shah
ea548cc3ab Merge "Updated Nullable annotation for #registerAppUsageLimitObserver." 2019-02-26 22:13:20 +00:00
Siarhei Vishniakou
ccf973fa9f Inject long press documentation
Clarify usage of Activity.onKeyLongPress(..). It is not obvious at
all that onKeyDown should be used in order for OnKeyLongPress to work.
Direct readers to the other api to make sure that this nuance is not
missed.

Bug: 21451760
Test: atest KeyEventInjectionTest
Change-Id: Ic73f6fe06b2108a3967ac590d22acfb283a700e1
2019-02-26 13:22:24 -08:00
Hui Yu
fb72b99051 Add API Service.getForegroundServiceType()
To return current foregroundServiceType if the service has become a
foreground service.

If service become foreground service by calling Service.startForeground(int,
Notification, int type), the returned type is the type specified.

If the no-type version Service.startForeground(int, Notification) is called.
the returned type is foregroundServiceType specified in manifest.

If no foregroundServiceType specified in manifest, the returned type is
zero.

If the service is not a foreground service, the returned type is zero.

Bug: 124517685
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java#testFgsLocation

Change-Id: Ibcc4431429a90aab92a5533e296fb104b4add9e6
2019-02-26 12:50:28 -08:00
TreeHugger Robot
8768f11463 Merge "Make assistant and telephony role names public API." 2019-02-26 18:14:30 +00:00
Felipe Leme
f6b8a28426 Merge "Added ContentCaptureEvents for session resumed and paused." 2019-02-26 16:28:49 +00:00
Wei Sheng Shih
e4f7a8e5ca Merge "Remove meaningless parameter in IActivityTaskManager#setLockScreenShown" 2019-02-26 02:33:49 +00:00
Keun-young Park
3ada2d8614 Merge "Add startUserInForegroundWithListener to IActivityManager" 2019-02-25 21:52:26 +00:00
Neil Fuller
08151535a8 Merge "Update RulesManagerService after APEX files" am: ee15067180 am: 7421a00bb0
am: efaa3e6801

Change-Id: I12b6017fdd0c280b5e023269fb8a52f717528c1c
2019-02-25 13:04:14 -08:00
TreeHugger Robot
4a79c63722 Merge changes from topic "view_tree_batch"
* changes:
  Changed Content Catpure workflow so it notifies when multiple changes are made.
  Improved how Content Capture events are flushed when activity is resumed / paused.
2019-02-25 19:22:05 +00:00
Neil Fuller
efaa3e6801 Merge "Update RulesManagerService after APEX files" am: ee15067180
am: 7421a00bb0

Change-Id: I86bba886037d93723957a33f913f6fa0c05e8b0f
2019-02-25 10:34:33 -08:00
Sooraj Sasindran
0acab502a0 Merge "Allow UiAutomation to adopt the shell permission indentity" am: 9f0115bb6e
am: 178684530b

Change-Id: If21a26f16b8c88f1dab56ac7fa7a804a1e9077b0
2019-02-25 09:25:50 -08:00
Hai Zhang
051cdc85e6 Make assistant and telephony role names public API.
Not sure about the car mode dialer and call companion app roles yet,
so leaving them out for now.

Bug: 125936031
Test: build
Change-Id: Ibe34256ea3c8c0514a7c97c641935c79c7da8d0d
2019-02-22 19:58:02 -08:00
Felipe Leme
b0da18f32e Added ContentCaptureEvents for session resumed and paused.
Test: atest CtsContentCaptureServiceTestCases # which was updated to listen to the new events
Test: m update-api

Fixes: 125395044

Change-Id: Ie1ed5d9badaa64ff0921226a1c08bd5e3cbf07d8
2019-02-22 18:10:22 -08:00
TreeHugger Robot
a9954d9aae Merge "Fixed when ContentCapture is finished." 2019-02-22 23:30:12 +00:00
Keun-young Park
42118d20ee Add startUserInForegroundWithListener to IActivityManager
Bug: 124797617
Test: Reboot the system and confirm user starting / unlocking with the call.

Change-Id: Id22cbc53a42c7a2e0bfbe006a871a6ba45e5c6d1
2019-02-22 13:11:32 -08:00
Ricky Wai
ccac071827 Merge "SystemAPI for setting app details activity state" 2019-02-22 20:19:03 +00:00
Felipe Leme
d58c1eaada Improved how Content Capture events are flushed when activity is resumed / paused.
We were flushing right after the activity resumed, but the relevant events (views added / removed)
were not generated yet, which made such flushes useless.

This CL changes the workflow to flush them after the ViewRoot finishes doing its work.

Test: atest CtsContentCaptureServiceTestCases

Bug: 125395044
Bug: 122315042

Change-Id: I05bf27069b00c285643b2d23ad6708a6ad7bc8f3
2019-02-22 12:14:36 -08:00
Felipe Leme
6fef91e839 Fixed when ContentCapture is finished.
The initial behavior cop^H^H^H based on Autofill, which only closes the session when the activity
finishes. But for content capture we must always close the session when the activity is stopped.

Test: manual verification
Fixes: 125628737

Change-Id: I064d4ace97721dd8fb20075c02e1f059ecbf942a
2019-02-22 11:15:03 -08:00
Neil Fuller
ee15067180 Merge "Update RulesManagerService after APEX files" 2019-02-22 18:32:13 +00:00
Mady Mellor
ffafec1f62 Merge "Remove title API from bubble metadata" 2019-02-22 17:43:04 +00:00
Chavi Weingarten
a471767911 Merge "Wait for input windows to be set before proceeding with inject for tests" 2019-02-22 17:34:43 +00:00
Neil Fuller
a1ae02519d Update RulesManagerService after APEX files
Context
=======

The "time zone updates via APK" feature was implemented in O-MR1 to enable
devices to take time zone updates via an APK update and without needing
an OTA. RulesManagerService is an important part of the time zone updates via
APK feature. When RulesManagerService was implemented things were simple; there
was a copy of time zone data in /system. A new (optional) copy was introduced
in /data that could be managed / updated by the RulesManagerService.
Since there were only two copies the /system copy was referred to as the
"system" data.

With the introduction of the runtime APEX and time zone data APEX things
have become more complicated. Android devices can have time zone data in
several places:

1 The copy in /system/usr/share/zoneinfo/ is partially complete and remains
  for legacy usecases, e.g. binaries that "know" about the /system path and
  cannot be updated, or binaries which run before /apex paths are mounted.

2 The copy in /apex/com.android.runtime/ is a complete set of time zone
  data that can be used by libraries on the device.

3 The copy in /apex/com.android.tzdata/ is the "overlay" copy for use when
  the time zone data APEX can be updated. For devices that can take APEX
  updates it will be present and is expected to start with the same version as
  present in /apex/com.android.runtime. Note: Nothing in the code *requires*
  this copy to be present but it is expected to be present in most cases.

RulesManagerService is being kept around for devices that may not have the
capability of updating their APEX files but which still want to update time
zone data without taking an OTA. It is assumed that RulesManagerService will
*only* be turned on in these situations and *not* when the time zone
data in /apex/com.android.tzdata/ might actually be updated independently of
the copy in /apex/com.android.runtime/.

The RulesManagerService therefore adds the fourth copy of the data that *could*
be present:

4 The copy /data/misc/zoneinfo/ managed by RulesManagerService.

Important libraries / binaries on device know about all 4 copies and
prioritize them in order 4, 3, 2, 1. i.e. the libraries will use the
first copy of data found in that order.

In scenarios where RulesManagerService is disabled, 4 will not be present
and therefore 3 will be used (or 2 if 3 is also not present).

In scenarios where RulesManagersService is enabled, 4 is present iff an
APK update has been received. It is assumed that *if* /apex/com.android.tzdata/
is present, it contains the same version of tz data as in
/apex/com.android.runtime/, will never be updated, and can therefore
be ignored by RulesManagerService.

The changes
===========

This commit and others in the same topic do the following:

1) Change RulesManagerService references to "system" data to "base" data in a
   valiant attempt to limit confusion until it can be removed.
2) Switch RulesManagerService over from using the data in
   /system/usr/share/zoneinfo/ as base data to the data in
   /apex/com.android.runtime/.  As part of this change, the RulesManagerService
   can now use the tz_version file to identify the version of tzdb in "base"
   rather than reading the header of the tzdata file, so that is done
   here too.
3) Update imports neccessary to meet pre-upload check requirements.

Note: tzdatacheck, an independent binary that manages time zone data
after OTA, was updated to use /apex/com.android.runtime/ instead of
/system/usr/share/zoneinfo/ in commit c6a2737e0861472d1726ed472708d7762ab1e802.

Bug: 119293618
Bug: 113373927
Test: atest FrameworksCoreTests:android.app.timezone
Test: atest FrameworksServicesTests:com.android.server.timezone
Test: CTS: run cts-dev -m CtsLibcoreTestCases -t libcore.libcore.timezone.ZoneInfoDBTest
Test: CTS: run cts-dev -m CtsLibcoreTestCases -t libcore.libcore.icu.TimeZoneIntegrationTest
Change-Id: Idabe245c7ad337938c202b1796ce9d89ec68bbd6
2019-02-22 15:43:39 +00:00
Wale Ogunwale
c6506833e3 Merge "Added some TestApi that are already used by CTS" 2019-02-22 12:51:57 +00:00
wilsonshih
177261f5a5 Remove meaningless parameter in IActivityTaskManager#setLockScreenShown
After ag/5760456, we can remove the parameter secondaryDisplaysShowing
since it becomes meaningless.

Fix: 123373363
Test: atest ActivityManagerMultiDisplayTests
      atest ActivityManagerDisplayKeyguardTests
      atest ActivityManagerDisplayLockedKeyguardTests
      atest KeyguardTests

Change-Id: I5ab5753985bc570bb730b4c7f801cdc263cc1858
2019-02-22 13:25:59 +08:00
Philip P. Moltmann
933c8e06e8 Merge changes from topics "policy_fixed_set_via_perm_controller", "protect-policy-flags"
* changes:
  Ask Perm Controller to set policy-fixed perms
  Guard changing policy_fixed flag behind permission
2019-02-22 04:39:31 +00:00
Wale Ogunwale
691af68a3c Added some TestApi that are already used by CTS
Allows us to remove the use of private platform API from CTS.

Bug: 124134247
Test: builds
Change-Id: Iceb81ff7c9385e877d2612fbb7b506245d116928
2019-02-21 20:15:56 -08:00
Mady Mellor
138f4c9ac5 Remove title API from bubble metadata
Test: atest NotificationTest (with the cts cl)
Bug: 124909846
Change-Id: Ia4611d4f63da0213ae0ff737355743396404b6e2
2019-02-21 18:25:33 -08:00
Felipe Leme
9873510af3 Merge "Refactored Autofill properties that are optimized on application level." 2019-02-22 01:02:46 +00:00
Philip P. Moltmann
41df9f94ae Ask Perm Controller to set policy-fixed perms
This is much slower than the old way as we need to call into a different
process. On the other hand this handles the following cases correctly:
- foreground / background permissions
- pre-M apps
- split permissions

Test: CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPermissionGrant,testPermissionPolicy,testPermissionMixedPolicies,testPermissionAppUpdate,testPermissionGrantPreMApp
Change-Id: I5cd139ad29e5b77b77b02e12c75eb774984a7759
Bug: 124128308
2019-02-21 16:56:25 -08:00
Philip P. Moltmann
2a537a6ef5 Guard changing policy_fixed flag behind permission
- Allow an app to change policy_fixed permissions
- Disallow apps >= Q to change the polic_fixed flag

Bug: 124128308
Test: Changed permissions that were policy_fixed
Change-Id: Ia94bae1b993bd8a18c93f866df2114c740fa17bd
2019-02-21 16:56:25 -08:00
chaviw
504715c505 Wait for input windows to be set before proceeding with inject for tests
Added a new test method to allow the client to wait until input windows
have been propagated to InputFlinger before proceeding to inject input.
This ensures that the inject is called when all windows have been set
up.

Bug: 123041491
Test: ListPopupWindowTest, PopupMenuTest
Change-Id: I42abfa4ea23a14ae1a003c6ee8976cc466f1d5af
2019-02-21 16:51:49 -08:00
Makoto Onuki
7a81c02723 Merge "Add ADB command to wait for system server crash" 2019-02-21 23:40:18 +00:00
Rich Cannings
f64ec63a02 Refactor passwords/pins/patterns to byte[]
Relating to frameworks/base

Bug: 120484642
Test: manual - test setting and unlocking passwords/pins/patterns.
      automated - about 20 failing due to an issue in the test code.

Change-Id: I57aa530ca2db1a026c56b66f5b4c91172f2667f6
2019-02-21 14:39:05 -08:00
Svet Ganov
c2841ec7fe Allow UiAutomation to adopt the shell permission indentity
For testing we often need to run shell commands. This can be done
today via running a shell command from an instrumentation test
started from the shell. However, this requires adding shell commands
which are not in the API contract, involve boilerplate code, require
string parsing, etc.

This change allows an instrumentation started from the shell to
adopt the shell UID permission state. As a result one can call APIs
protected by permissions normal apps cannot get by are granted to
the shell. This enables adding dedicated test APIs protected by
signatures permissions  granted to the shell.

Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases
          -t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions

bug:80415658

Merged-In: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
2019-02-21 19:59:14 +00:00
Felipe Leme
a4f39cd150 Refactored Autofill properties that are optimized on application level.
Prior to this CL we were just caching whether the service supported compatibility mode for the app,
but now we're also caching the logging level and whether the app is whitelisted for augmented
autofill - although right now the augmented autofill info is not used, it will allow us to trigger
it in the scenarios where autofill is disabled for the app.

Bug: 123099842
Bug: 123100824
Test: atest CtsAutoFillServiceTestCases:AugmentedLoginActivityTest \
            CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest
      atest CtsAutoFillServiceTestCases # sanity check, although still flaky

Change-Id: Iaf8ea6634ca94e5e61131890ec17c96c2fbb329a
2019-02-21 10:44:39 -08:00
Ruslan Tkhakokhov
1422033905 Merge changes from topic "cts-launcher-api"
* changes:
  Fix BackupManager#getUserForSerialNumber
  Do lazy init of BMS at the beginning of every BackupManager method
2019-02-21 18:20:05 +00:00
Chavi Weingarten
d282641a1d Merge "Make WindowContainer surfaces container layers by default." 2019-02-21 18:03:14 +00:00
Ricky Wai
92cd00622b SystemAPI for setting app details activity state
Priv-app can use it to enable / disable AppDetailsActivity of an app

Bug: 124378857
Test: Able to compile
Change-Id: I3122d7c1a18362cecdcea17b14d21b7c0ce12754
2019-02-21 17:31:13 +00:00
Mady Mellor
5c9cd6879c Merge "Add API so apps can know when a user dismisses a bubble" 2019-02-21 17:14:56 +00:00
Mark Renouf
f9aa3044f2 Merge "Adds TaskInfo to some TaskChangeListener methods" 2019-02-21 15:11:05 +00:00
Felipe Leme
326f15a392 Optimized Content Capture workflow by caching some state at the application level.
Content Capture for an activity and/or package is only available when the Content Capture service
explicitly whitelists it. As the whitelist is kept at system-server level, it's better to fetch that
info when the application is started and cache it locally, so we can optimize the
ContentCaptureManager APIs to return quickly when it's disabled.

This CL also caches other values such as the buffer parameters.

Test: atest CtsContentCaptureServiceTestCases

Bug: 120494182
Bug: 121202151

Change-Id: I9d5211bca496ffa85ba9efc2a7bb32411834b787
2019-02-20 18:44:05 -08:00