17 Commits

Author SHA1 Message Date
Jiyong Park
e86e89acff Add filegroups for services.* libraries
... in preparation for creating a stub library from services.jar

Bug: 139391334
Test: m

Exempt-From-Owner-Approval: cherry-pick from internal

Merged-In: Ifd6cfc77acf2284804a2f64011c2733b5c222369
(cherry picked from commit bae2e907966dce0cb3eaf3e3a81cca4364b7d941)
Change-Id: Ifd6cfc77acf2284804a2f64011c2733b5c222369
2019-12-11 15:55:33 +09:00
Michal Karpinski
670b0d58f7 Fix NPE in CompanionDeviceManagerService#unlockUser()
Test: manual
Bug: 130221860
Change-Id: I77f59d3b60fb79fc3b975449903ad28b5b7893e2
2019-04-10 11:02:54 +01:00
Michal Karpinski
da34cd4f0e Allow companion apps to start background activities from
PendingIntents (even if they aren't foreground)

And push companion packages to ATMS after the user is
unlocked.

Bug: 129757565
Test: atest WmTests:ActivityStarterTests
Test: manual
Change-Id: Ic76d5c8a3fb096a8caf76dafb6c38212a8506f3a
2019-04-03 15:53:53 +01:00
Ricky Wai
2452e2d068 Allow associated companion app to start background activity
Bug: 123272462
Test: Able to compile, will have a follow up CTS
Change-Id: Ic8d6f0df95b426a87711f5432dd7d5aec5a17886
2019-03-28 14:50:11 +00:00
Philip P. Moltmann
a6f5c70b91 Allow to influence how loadSafeLabel works
Also remove all references to old loadSafeLabel method to prevent
proliferation of old method via copy+paste.

The implementation assumes that there are three cases:
- Short labels that don't have anything wrong with them
- Labels that are fine, but are a little too long
- Intentionally bad label that try to break stuff and slow things down.

In the first two cases no characters are marked for removal, in the
third case we have an implementation that does not use a lot of memory
and has linear performance when there are a lot of bad characters.

Test: gts-tradefed run gts-dev -m GtsContentTestCases
Bug: 77964730
Change-Id: I3feb17b2a12018cd5407c88fe3603f2ebbc9d14e
2018-05-08 11:27:41 -07:00
Colin Cross
e0b2ee52d2 Convert services to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Exempt-From-Owner-Approval: trivial conversion
Change-Id: I417409281c928ea667d937090d2a0d9d72a449a2
2017-12-08 21:00:15 +00:00
Eugene Susla
2f5ee71ec8 PooledLambda
This introduces PooledLambda - a way of obtaining lambdas without the
allocations overhead.

See PooledLambda javadoc for a guide and PooledLambdaSample for code samples
of useful usages.

Test: ensure samples of PooledLambdaSample work as described.
Change-Id: I46f8ad27bc1de07e19f6e39f89d2cafe4238497a
2017-12-05 10:46:59 -08:00
Eugene Susla
612311ef41 [Companion] Dont store duplicate association records
Fixes: 62675985
Test: Assosiate the same item twice and ensure getAssociations lists it
only once
Change-Id: I028c08010740baaa04464647dffa701fc066a4fe
2017-07-07 14:37:37 -07:00
Eugene Susla
7a090a11ed [Companion] Dont crash if started with bluetooth off
Bug: 63068644
Test: Turn BT off, and ensure the attached bud doesn't reproduce
Change-Id: I0de5ba6d28d7195dd3ebc7a3af36f057c762de60
2017-06-28 11:01:04 -07:00
Eugene Susla
eebd276715 Fix companion uses-permission enforcement
Fixes: b/62662686
Test: Call CompanionDeviceManager#associate from app without uses-permission
declaration
Ensure exception is thrown

Call the method from app with the declaration
Ensure no exception is thrown

In debug mode catch the #isCallerSystem call from NotificationManagerService 
(which runs in the system process) and ensure it passes the check
Change-Id: I26e5d2a7f5e63a346d4ab50b9ded1ec7dbc246a5
2017-06-15 18:30:44 +00:00
Eugene Susla
6fd0ce3616 Avoid activity leak via Companion callback
Test: invoke associate() API and ensure it still works
Change-Id: I9aedb043b4b1f0d77f076d8753cd60ff7c98a7d6
2017-05-11 13:58:28 -07:00
Eugene Susla
066422180b Rename Companion permissions
Test: ensure permission check still works
Fixes: 37721270
Change-Id: I1ff5c2924ee837c8b4a6e2825dce171e6a2e00cb
2017-04-27 19:14:17 -07:00
TreeHugger Robot
60c17e06e8 Merge "Expose Companion API via shell command" into oc-dev 2017-04-27 05:56:02 +00:00
Eugene Susla
a5ccbbc169 Expose Companion API via shell command
Usage:
adb shell cmd companion_device ...

Test: Call each subcommand and ensure it works
Change-Id: I383995221384013b798fdd1c30a2846e14f7ad06
2017-04-26 20:25:27 +00:00
Eugene Susla
d74e65944d Drop uses-feature requirement for system process
Fixes: 37673382
Test: go through setup wizard and ensure no exception from bug report
  is present
Change-Id: I5a64586c1baec54ae579f47771546493f82b19df
2017-04-25 12:57:23 -07:00
Eugene Susla
aa43a4ba9f Check for uses-feature in Companion APIs
Fixes: 37629514
Test: Invoke API from app without uses-feature
Ensure an exception with an appropriate message is thrown
Invoke API from app with uses-feature
Ensure no exception

Change-Id: I53665732264ea2de2b4c8c251b1f00bf3a256dad
2017-04-24 11:17:06 -07:00
Eugene Susla
0d3dd12fa0 Move CompanionDeviceManagerService to a place of its own
Fixes: 37473452
Test: Ensure companion devi9ce functionality still works
Change-Id: I89624217373b3e77296c71f9429387d99d15e236
2017-04-18 12:00:11 -07:00