Commit Graph

1429 Commits

Author SHA1 Message Date
TreeHugger Robot
78c7be7c05 Merge "Clean up after VibratorManager feature introduced" into sc-dev 2021-02-15 16:14:26 +00:00
Lorenzo Colitti
202658f0a4 Merge changes Ia68f482a,I4911e214,Ied379654,I66d18512,Ie8e1bd63 am: 45ec3191a7 am: 246444fef7 am: ed9730e6f9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1581293

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I698b6b082b121c004b2c8b05ef423da1bd8b871b
2021-02-15 01:32:50 +00:00
Lais Andrade
43bf46112c Clean up after VibratorManager feature introduced
- Move VibratorManagerService to com.android.server.vibrator and make
all other classes there package-private;
- Add some missing haptics-related files to OWNERS files;
- Remove some unused methods;
- Delegate CombinedVibrationEffect to input devices, instead of only
delegating VibrationEffect effects;
- Move vibratorservice.proto to vibrator folder and add missing fields;
- Mark large VibrationThread tests with @LargeTest;

Fix: 131311651
Fix: 177805090
Test: VibratorManagerServiceTest
Change-Id: Ic747190b70b2f45ac7671eb01f8f05cf66d3a96c
2021-02-12 14:45:58 +00:00
Lorenzo Colitti
f83d22b77d Add a skeleton VpnManagerService, and start it on boot.
This adds a lot of unused code but this should make it easier to
review subsequent CLs.

Bug: 173331190
Test: builds, boots, "dumpsys vpnmanager" succeeds
Change-Id: Ied379654a0c3ab6242d3125661fe30f322395059
2021-02-12 01:07:29 +09:00
TreeHugger Robot
ba4fa60b35 Merge "Introduce SystemVibratorManager" into sc-dev 2021-02-11 13:12:18 +00:00
Lais Andrade
55a0aebe7f Introduce SystemVibratorManager
Add default system implementation of vibrator manager service that uses
IVibratorManagerService to access the device vibrators.

Change implementation of SystemVibrator to use VibratorManagerService
and delete local service VibratorService.

Introduce missing public APIs for VibratorManager and Vibrator.getId.

Bug: 167946816
Test: VibratorManagerServiceTest, VibratorTest, VibrationEffectTest
Change-Id: I55cdeb72c7ca39ccf0c7b2fda60b16de1031801e
2021-02-11 09:26:21 +00:00
TreeHugger Robot
8319d59769 Merge "Print exception via Slog, not .printStackTrace()." into sc-dev 2021-02-10 18:58:48 +00:00
Josh Gao
c4208aae23 Print exception via Slog, not .printStackTrace().
Bug: http://b/176389805
Test: treehugger
Change-Id: I649b6f06d5fa1222452c49efde76e393750f670f
2021-02-09 01:48:39 -08:00
Collin Fijalkovich
f6b292cc0f Merge "Introduce TracingServiceProxy System Services" am: 4512e77b7c am: a8d0cc257e am: 0f7ec99e75
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1527766

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5b9efe2ad8a9e94fd920c9daf4c109213d614536
2021-02-08 21:36:53 +00:00
Collin Fijalkovich
4512e77b7c Merge "Introduce TracingServiceProxy System Services" 2021-02-08 17:24:06 +00:00
Josh Gao
e18b895a74 Merge changes I8b85d8ee,I789f41f1 am: ddaf564365 am: 4359428db3 am: b4d05a90e9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566718

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3dd17a5aae56597a1eb233dd4743b4deb21ef5d9
2021-02-05 21:45:26 +00:00
Josh Gao
ea0255570e fdtrack: generate a heapdump when triggered.
It's somewhat hard to debug with just allocation backtraces when the
cause of the leak is a Java object leak. Generate an hprof dump when
this happens.

For privacy reasons, we don't include this in bugreports, since the
contents of system_server's memory is highly sensitive: they must be
manually requested from dogfooders.

Bug: http://b/176389805
Test: manual
Change-Id: Ib7755433395f341d90b732f285f00c8675291139
2021-02-05 03:06:16 -08:00
Winson
ee612e99fe Address domain verification API comments
Changes package to pm.verify.domain, removes throwing InvalidDomainSet,
cleans up permissions, and renames DomainVerificationSet ->
DomainVerificationInfo.

Bug: 163565712
CTS-Coverage-Bug: 179382047

Test: atest com.android.server.pm.test.verify.domain

Change-Id: I5d60c227f0e529fe27c1844ada97716933a533b0
2021-02-04 10:27:01 -08:00
Winson
47dbabfc14 Convert DomainVerificationService.Connection to synchronous set
Unfortunately it's possible to call this during PackageManagerService
initialization, so this needs to be attached before PMS gets created.

Rather than using a deferred injection, this makes PMS call
setConnection to directly set the callback. A better isolated might be
worth exploring in the future, but overall it shouldn't really matter.

Exempt-From-Owner-Approval: Already approved by owners on main branch

Bug: 163565712

Test: com.android.server.pm.test.domain.verify

Change-Id: Ib60f5560ecaa510474228aa1c38eff5d6041ab58
2021-02-04 10:27:00 -08:00
Winson
96694aa7bd Attach domain verification states during package scan/install
Handles adding a new package (either from a brand new install or a boot
scan) and migrating between packages when installing an update.

Will merge the package states in the update case to preserve successful
verifications while removing failed domains so that they can be
re-requested by the verification agent.

Exempt-From-Owner-Approval: Already approved by owners on main branch

Bug: 163565712

Test: manual, device boots, will be tested as part of later changes

Change-Id: I54dc8415e10544e618905e269ab95ec0a2af0fb0
2021-02-04 10:26:59 -08:00
Winson
dd04535e9b Wire up DomainVerificationService to PackageManagerService
Sets up the callback and the actual service initialization so that
future domain verification changes can access PackageManager APIs.

Exempt-From-Owner-Approval: Already approved by owners on main branch

Bug: 163565712

Test: none, device boots, tested implicitly as part of other changes

Change-Id: Ie75ad0ee002ae92c21387777ff41c2504c69b836
2021-02-04 10:26:58 -08:00
Winson
018a009920 Add DomainVerificationService skeleton
Just the basic SystemService so that future CLs can add methods. Starts
the service in SystemServer, but effectively does nothing.

Exempt-From-Owner-Approval: Already approved by owners on main branch

Bug: 163565712

Test: none, just a skeleton

Change-Id: I1388423894e1e96511ab0f7de8ac5a7c2eea6de0
2021-02-04 10:26:58 -08:00
Josh Gao
9a8b4358d3 Extract tombstone tracking to a separate service.
In preparation for making tombstones available to apps, extract the
tombstone tracking code from BootReceiver to its own service.

Bug: http://b/159164105
Test: manual
Change-Id: I789f41f12a8be312b6e966226646c4ec4becc1aa
2021-02-03 14:08:12 -08:00
Hai Zhang
e7d97083aa Merge "Start role service earlier." into sc-dev 2021-02-02 22:34:27 +00:00
TreeHugger Robot
b23f6d71ee Merge "Move GameManager to android.app package." into sc-dev 2021-02-02 19:36:13 +00:00
Hai Zhang
a101dc88e0 Start role service earlier.
Role service is modularized in this release and allows lower level
roles to be introduced after role logic is moved from
PermissionController APK into the system server JAR. So move starting
role service earlier as well to allow lower level roles.

This has no immediate effect because currently initialization for all
roles happens upon user start, but once role logic is inside system
server, we can allows initializing certain roles earlier in the boot
process, e.g. via SystemService.onBootPhase().

Fixes: 178565325
Test: presubmit
Change-Id: I8d183553f08aa6200aa3566afaabd40a7ce9489c
(cherry picked from commit d93060190f)
2021-02-02 18:54:30 +00:00
Shashwat Razdan
fc890f1fba Merge "SmartspaceManager initial implementation" into sc-dev 2021-02-02 12:31:26 +00:00
Shashwat Razdan
d33e8c387a SmartspaceManager initial implementation
Bug: 176851064
Test: Deployed on Phone,CTS tests
Change-Id: I3e03628d4d0e0aec0b6442f0ee8949ac378a1572
2021-02-01 21:39:07 +00:00
Tony Huang
d346ee5315 Merge "Make AppTransition animations sharable (1/n)" into sc-dev 2021-02-01 10:16:33 +00:00
Hyundo Moon
666804029d Merge "Add a new system service: MediaCommunicationService" into sc-dev 2021-02-01 06:11:27 +00:00
Chalard Jean
1595b1aa38 Merge "Start VcnManagementService after ConnectivityService" 2021-02-01 04:38:08 +00:00
Peiyong Lin
235cb5086c Move GameManager to android.app package.
Bug: b/177611751
Bug: b/178112303
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Icf01f723f1323f6f91030e6005958b7da05e8177
2021-01-29 20:58:52 -08:00
Peiyong Lin
32f6ff7e15 Add GameManager service.
GameManager service is a service to manage game related features. This
patch creates the initial service to manage the game mode and persist
the data across reboot.

Bug: b/174956354
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Iee2ab47c79d29f48847bc6d4b3eb781a5af18ff4
2021-01-29 09:18:34 -08:00
Benedict Wong
3877b57b1d Start VcnManagementService after ConnectivityService
This change alters the start-up order of the VCN and Connectivity
services.

Bug: 174636568
Test: atest FrameworksVcnTests
Test: atest FrameworksNetTests
Change-Id: I1af29d52b94e77781eb2bf2082fcbe43648ee800
2021-01-28 18:30:27 +00:00
Sergey Volnov
bf51d7482c Merge "Add System speech recognition service." into sc-dev 2021-01-28 16:55:27 +00:00
Hyundo Moon
47b63528c3 Add a new system service: MediaCommunicationService
Bug: 175511943
Test: MediaCommunicationService can run.
      'adb shell service list' shows the service.
Change-Id: I81a1e11d96d1d30a29760507be6fe04592afcf70
Merged-In: I81a1e11d96d1d30a29760507be6fe04592afcf70
2021-01-28 13:07:53 +00:00
Benedict Wong
919d9cc1a6 Start VcnManagementService after ConnectivityService
This change alters the start-up order of the VCN and Connectivity
services.

Bug: 174636568
Test: atest FrameworksVcnTests
Test: atest FrameworksNetTests
Change-Id: I1af29d52b94e77781eb2bf2082fcbe43648ee800
Merged-In: I1af29d52b94e77781eb2bf2082fcbe43648ee800
2021-01-28 08:15:09 +00:00
Tony Huang
5fcda4f860 Make AppTransition animations sharable (1/n)
Move some animation functions in AppTransition to new
TransitionAnimation class for wm-shell using.

Bug: 175053726
Test: build
Change-Id: I7eef67359fd4532f7e4d97c787d5288362a32f13
2021-01-28 16:03:56 +08:00
Collin Fijalkovich
a5ceac1196 Introduce TracingServiceProxy System Services
Introduces a new SystemService to act as intermediary between the
Perfetto trace daemon and Traceur.

Bug: 175591887
Test: adb shell service call 1 i32 0/1

Change-Id: Idea7761a8479827f0cfa561e56ba2beac3072939
2021-01-27 13:40:58 -08:00
Neil Fuller
040dc8e2cd Move code from c.a.server.location.timezone
Move code from com.android.server.location.timezone to
com.android.server.timezonedetector.location.

It has more in common with time zone detection than location code.

Bug: 175119330
Test: Treehugger
Change-Id: I80e8c88ba1e3903f3b662cb195c5b2877ba661b0
2021-01-27 17:24:38 +00:00
Eugenio Marchiori
c3c0a1ee7e Add System speech recognition service.
Bug: 176578753
Test: local demo, CTS will follow
Change-Id: Ia7766c506bf43a5db5b9719363da66aab263fd8d
2021-01-27 09:40:27 +00:00
Josh Gao
a01cecbde9 Merge "Thread.sleep takes milliseconds, not seconds." am: b79bd2867f am: 81830b2d5f am: 629791842e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560108

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie06960dc37d80daebce68bf51e58b1b4cb7c6c0f
2021-01-27 07:59:01 +00:00
Treehugger Robot
ed907b9203 Merge "Add app hibernation service stubs" am: d7bac025fb am: d131f3737d am: 1438f59fb0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1544924

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I938d23eada77c80966b710a373de927adf72fae4
2021-01-27 07:56:38 +00:00
Josh Gao
b79bd2867f Merge "Thread.sleep takes milliseconds, not seconds." 2021-01-26 23:36:05 +00:00
Treehugger Robot
d7bac025fb Merge "Add app hibernation service stubs" 2021-01-26 22:23:13 +00:00
Josh Gao
e8575f53f8 Thread.sleep takes milliseconds, not seconds.
Test: treehugger
Change-Id: I822937ecd7778f0b9cf2fd22d281ace195f7cb56
2021-01-25 18:30:34 -08:00
Yi Jiang
0127af73ed Introduces RotationResolverService to the system
Rotation Resolver Service provides the suggested screen rotation
to the system server.

Bug: 162359770
Bug: 172370409
Test: atest RotationResolverManagerPerUserServiceTest
Change-Id: Ia43dfdba8502e04768933ef46a4ac8a687d4936c
2021-01-25 20:58:14 +00:00
Hai Zhang
0b4f1718f8 Move role into module.
These changes have to be in this CL together because:

- Code in service-permission depends on IRoleManager in
framework-permission, so the APIs in framework-permission and the code
in service-permission need to be moved together.

- The changes to service-permission build rules doesn't make sense
without the code moved in, so they have to be together as well.

Other details:

- framework-annotations: Several annotations are added into
framework-annoatations. Since the discussion with API council seems to
allow user IDs in system server in-process APIs, @UserIdInt and
@AppIdInt is added. @MainThread and @AnyThread is added since
@WorkerThread is already added. @CallSuper is added since @CheckResult
is also already added and they are similar in terms of category of
functionality.

- framework-permission-s-shared-srcs: 3 classes (and 2 AIDL files)
from framework is copied as shared source files and jarjared for
framework-permission, and an additional 3 is added for
service-permission as service-permission-shared-srcs. Similar to
framework-wifi and service-wifi, the 3 classes in framework-permission
is also available to service-permission by the stub library
framework-permission-pre-jarjar, and the other 3 classes used only for
service-permission is included separately to minimize our impact on
classes loaded into boot classpath. framework-permission and
service-permission shares the same jarjar rules to make sure the
classes remain available, and for the same reason framework-permission
cannot be shrank during any optimization.

- framework-permission-s-shared: A java_library target for
framework-permission-shared-srcs is created to make sure that the
public classes won't be counted as APIs, as it would be if directly
included as srcs for framework-permission
java_sdk_library. service-permission-shared is the same thing for
service-permission.

- framework-permission-s: A new java_sdk_library target created to be
loaded into bootclasspath by Android S+.

- Dumpsys Protobuf: The dumpsys protobuf
file (rolemanagerservice.proto) is moved into the module, and both the
platform (incident.proto) and the module uses protoc-gen-javastream to
generate the Java classes from it. This should be fine since it's a
"source level inclusion", and we jarjar the generated classes in our
module to avoid conflict with platform copies.

Bug: 158736025
Test: manual
Test: device boots, default apps can be changed successfully.
Change-Id: I1914774f631e51d0c587a7e527a1c9bc05ee1595
2021-01-24 12:55:16 -08:00
Hai Zhang
0de31fe1e2 Prepare role code for modularization.
- PooledLambda: PoolLambda is replaced with plain lambdas, to avoid
adding ~20 classes to boot classpath (for each module that uses
lambda).

- SystemServiceRegistry: RoleFrameworkInitializer is added to add
ROLE_SERVICE, similar to other modules.

- RoleService: RoleManagerService is renamed to RoleService to better
reflect the manager/service relationship.

- @MainThread: import for Looper is removed because it's only used in
javadoc and triggers package not exist error during build. @linkplain
in the javadoc is also removed because it triggers an error in
Metalava parsing and isn't critical.

- Added small utilities: These utilities has their full version in
platform, but is too large and contains too many internal references
in methods unreferenced by role, whereas actually role only needs 1 or
2 methods from them. So just create a small copy of the used methods
for role modularization, and they will be moved into APEX with role.

Bug: 158736025
Test: manual
Change-Id: I74f20b37d23370e258e7fc7130e28c5312abf46c
2021-01-22 14:27:00 -08:00
Hai Zhang
d066c7c933 Move computePackageStateHash() implementation into platform.
The computePackageStateHash() implementation needs
PackageManagerInternal.forEachInstalledPackage(),
getApplicationEnabledState(), getEnabledComponents() and
getDisabledComponents() to work, for which we don't have good
alternatives in API. Even if we added those APIs, generating and
iterating over PackageInfo for all packages in the system would surely
drive up CPU and memory usage and regress our performance, and the new
AndroidPackage system APIs isn't ready in S yet. So we can move
computePackageStateHash() implementation into platform. Once we move
role logic into system server, granting default roles may be fast
enough and we may consider the deprecation/removal of this.

This way we can also remove the final dependency we have on
PackageManagerInternal and be ready for modularization.

Bug: 158736025
Test: presubmit
Change-Id: I14119f2e95c861ee3539108748a4912b051b4462
2021-01-21 13:55:56 -08:00
Eva Chen
3164ff667d Merge changes Ife27ecd6,I1a893ea8
* changes:
  Add GnssTimeUpdateService.
  Add meta-text about gnss time update attribution.
2021-01-21 01:09:18 +00:00
Eva Chen
270ae737c2 Add GnssTimeUpdateService.
GnssTimeUpdateService listens for location updates. Once an update is
received, it reads the time provided by GPS and suggests it to
TimeDetectorService. TimeDetectorService can then use it to set the
SystemClock based on included time sources and priority.

Bug: 157265008
Test: Presubmits + atest + Manual
- atest frameworks/base/services/tests/servicestests/src/com/android/server/timedetector/GnssTimeUpdateServiceTest.java
- For manual testing, the Location Shell Commands can be used to add /
  enable a gps test provider to set gps locations with a specified time.
  The time detector dumpsys can then be used to verify that a GNSS
  suggestion has been made.

Change-Id: Ife27ecd6d122f33b7cc93d7832e3085acc33c160
2021-01-20 14:48:12 -08:00
Hai Zhang
ce2a80437d Use a single interface for reading pre-Q and pre-S role state.
The logic to read the platform XML is moved from RoleUserState. The
logic to read legacy settings is left untouched except refactored to
return the mapping at once.

Bug: 158736025
Test: presubmit
Change-Id: Ifd1770bf869ea77b2f8a4ff8b3eae46a46cc90cf
2021-01-15 13:36:55 -08:00
Josh Gao
1c687e16a6 Merge changes I0f1d59ae,I2f63bffb am: 9f7a73fc21 am: 87caaf0da8 am: e0cbabe562
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1432973

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0298ef531a86502e0da39b68193f2647a13ce01d
2021-01-14 04:43:26 +00:00
Josh Gao
9f7a73fc21 Merge changes I0f1d59ae,I2f63bffb
* changes:
  fdtrack: GC before checking fd count.
  Move system_server fdtrack implementation to Java.
2021-01-14 01:22:22 +00:00