Commit Graph

1123 Commits

Author SHA1 Message Date
Mårten Kongstad
77b53b2c56 Remove the FEATURE_FLAG_IDMAP2 flag
Test: atest OverlayDeviceTests OverlayHostTests FrameworksServicesTests:com.android.server.om CtsAppSecurityHostTestCases:OverlayHostTest

Change-Id: Ib68eaf7f721c5d440fe7185777e88e23cb9840a4
2019-10-01 00:08:48 -07:00
Tej Singh
c53ac0ad2b Move statscompanion to statsd-service jar
This moves statscompanion to statsd-service.jar, and out of
services.jar, in preparation to add it to the statsd apex. In later CL's
I will start making the communication to the rest of system server go
accross approved boundaries. I will also make a second service in system
server to put pullers and other things that we do not care about
updating.

Test: builds, boots, statscompanion talks to statsd
Change-Id: Id7c36bfe4c2138edd4a19f3f477ce31c2f1973d3
2019-09-27 17:07:11 -07:00
Makoto Onuki
52c24b377b Move DeviceIdle to the JS apex
Test: atest cts/tests/tests/batterysaving/src/android/os/cts/deviceidle/DeviceIdleTest.java
Bug: 137763703
Change-Id: I836350c09f45f95afbf90b562ab1ceed75526498
2019-08-23 16:03:30 -07:00
atrost
de54a8ac4c Start platform compat service eariler.
It's needed by ActivityManager and PackageManager.
Also use a constant in Context for the name.

Test: flashed device with ag/9025572 and ag/9204795 and the platfrom
compat was accessible.

Change-Id: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
2019-08-19 12:26:24 +01:00
TreeHugger Robot
29569b5114 Merge "Revert "Revert "Don't start intelligence services that are not provided by the OEM.""" 2019-08-15 07:36:07 +00:00
Felipe Leme
83e8f2464f Revert "Revert "Don't start intelligence services that are not provided by the OEM.""
This reverts commit b897b173c1.

Reason for revert: real fix on Iea89b3d379792327657e01869c9494975e7b0306

Bug: 139416391
Bug: 135218095
Change-Id: Ib8f97ca460ccea90d2b674e83cbda2a62be2538e
Test: none
2019-08-14 16:57:56 +00:00
Wale Ogunwale
b897b173c1 Revert "Don't start intelligence services that are not provided by the OEM."
This reverts commit c6fff2524b.

Reason for revert: causing WM pre-submit tests to fail on go/wm-tests

Change-Id: I7a6db671f17fb056f29d5e02f58a7da88afda7ed
2019-08-14 13:04:40 +00:00
Roshan Pius
6f5338dd8f Mainline wifi stack module
a) Moved wifi service to a separate APK
b) Use the IWifiStackConnector to load the wifi stack from
SystemServer (similar to network stack).
c) Create a new WifiStackClient interface for system server to interact
with the wifi stack (under new services/wifi folder). Note: This not planned
to be updated via wifi-sdk Apex.
d) Add priv-app permissions for the new wifi stack APK.

Bug: 113174748
Test: Device boots up & connects to wifi networks, hotspot toggle, etc.
Test: Will send for regression tests
Change-Id: I54b3a11ed30668bad5a387370484b2bb0eabca5f
Merged-In: I54b3a11ed30668bad5a387370484b2bb0eabca5f
2019-08-12 07:22:56 -07:00
Roshan Pius
7e6f5f5e08 NetworkStackClient: Refactor network stack process interaction
Refactor NetworkStackClient class to move the module service binding &
network stack process death monitoring to a separate class. This class
will only instantiated in the SystemServer process.
The new class |SystemServerToNetworkStackConnector| will be used from
the client classes corresponding to each module running on the network
stack process (NetworkStackClient, WifiStackClient, etc)

This has 2 main advantages:
a) Reduces code duplication (Otherwise the various Client classes need
to replicate the service bindding & process death monitoring).
b) Central crash recovery for the network stack process (Otherwise the
various Client classes will trigger multiple recovery for a single
network stack process crash).

Bug: 135679762
Test: Device boots up & connects to wifi networks.
Change-Id: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
2019-08-12 07:22:56 -07:00
Felipe Leme
c6fff2524b Don't start intelligence services that are not provided by the OEM.
Bug: 135218095

Test: adb shell service check content_suggestions
Test: adb shell service check app_prediction
Test: atest CtsContentSuggestionsTestCases CtsAppPredictionServiceTestCases # on Automotive

Change-Id: I07f9873a7ad0c6dd1c1a0d6a0e5e05681bfc67fc
(cherry picked from commit 1d183917239d974964a7b60ae691ef57242d3135)
2019-08-09 09:06:41 -07:00
Felipe Leme
34a861add1 Fixes usage of WallpaperManager to make it optional.
As the main javadoc states:
"An app can check whether wallpapers are supported for the current user,
by calling {@link #isWallpaperSupported()}, and whether setting of
wallpapers is allowed, by calling {@link #isSetWallpaperAllowed()}."

Test: manual verification on automotive
Test: atest CtsAppTestCases:android.app.cts.WallpaperManagerTest # on automotive

Bug: 138939803

Change-Id: I88946f92ff54e556d289c41c28e22da3a4b8c8b8
2019-08-07 21:08:52 +00:00
TreeHugger Robot
cf695aabfd Merge "Move InputMethodSytemProperty to server from client." 2019-08-01 00:41:25 +00:00
Makoto Onuki
3074086120 Merge "Move the job scheduler service code to its own jar file." 2019-07-30 15:27:16 +00:00
Makoto Onuki
792de8d648 Move the job scheduler service code to its own jar file.
- Also remove the dependency from SystemServiceRegistry to JobScheduler

See apex/jobscheduler/README_js-mainline.md for the details.

Bug: 137763703
Test: build and boot
Test: atest CtsJobSchedulerTestCases
Change-Id: I2386c78b7a6085d6e543a63f22cb620c4cabd06a
2019-07-29 09:32:02 -07:00
Svet Ganov
3c499ea9ef Don't drop restricted permissions on upgrade
Restricted permissions cannot be held until whitelisted. In
a P -> Q upgrade we grandfather all restricted permissions.
However, the whitelisting code runs after the internal update
of permission happens for the first time resulting in a
revocation of the restricted permissions we were about to
grandfather.

The fix is to not deal with restricted permission when updating
the permissions state until the permission controller has run
the grandfathering logic and once the latter happens we do run
the permission update logic again to properly handle the
restricted permissions.

Bug: 138263882

Test: atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
      P -> Q upgrade preserves grandfathered restricted permissions
      P -> Bad Q build -> Q fixes up broken fixed restricted permissions

Change-Id: Iaef80426bf50181df93d1380af1d0855340def8e
(cherry picked from commit 0b41c8940a)
2019-07-28 04:47:27 +00:00
Makoto Onuki
a0eb2ddf1a Merge "Revert "Move the job scheduler service code to its own jar file."" 2019-07-25 18:13:15 +00:00
Makoto Onuki
a0c692ff9f Revert "Move the job scheduler service code to its own jar file."
This reverts commit 136d1ecf1e.

Reason for revert: My device didn't boot. :(

Change-Id: I11636c2ad03a3c14f5953a700fc3a2d629a81a42
2019-07-25 18:09:14 +00:00
Makoto Onuki
9343ae0bbe Merge "Move the job scheduler service code to its own jar file." 2019-07-25 16:40:30 +00:00
Makoto Onuki
136d1ecf1e Move the job scheduler service code to its own jar file.
- Also remove the dependency from SystemServiceRegistry to JobScheduler

See apex/jobscheduler/README_js-mainline.md for the details.

Bug: 137763703
Test: build and boot
Test: atest CtsJobSchedulerTestCases
Change-Id: Ic8ae8e99e6600b261618b5cfb6590d3f3664ae9f
2019-07-24 14:50:47 -07:00
Andrei Onea
cf10984410 Make PlatformCompat a Binder class
This allows PlatformCompat to be called from anywhere in the platform.
In follow-up CLs, we'll define permissions for each method and/or
filtering rules to prevent abuse from apps.

Test: m
Bug: 137769727
Change-Id: I19e5fbfefcf59e0b53b197ea8e9e3cb78439b4c4
2019-07-23 18:12:43 +01:00
Tarandeep Singh
07b318bdfc Move InputMethodSytemProperty to server from client.
Moving InputMethodSystemProperty from android.view.inputmethod to
com.android.server.inputmethod so that it can be accessed only from
the system_server.

Change-Id: I41707a4e5dfe824cbe9e873ec598762d36c64c09
Fix: 137203823
Test: Build and flash
2019-07-18 11:30:17 -07:00
Neil Fuller
60b858bd6b Merge "Remove the ability to turn off TimeDetectorService" 2019-07-03 08:07:05 +00:00
Neil Fuller
bef7e809ed Remove the ability to turn off TimeDetectorService
Remove the ability to turn off TimeDetectorService. After
http://r.android.com/1000492 it will be required in all cases.

Also remove [Old|New]NetworkTimeUpdateService as the expected
changes have not been implemented.

Bug: 133492648
Test: build only
Change-Id: Iad7ff59b19fa54750831819c68b7b733e5763902
2019-07-02 13:36:05 +01:00
Patrick Baumann
02d10eb6c6 Merge "Call ActivityManagerService.enterSafeMode" into qt-dev am: cfa47f6183 am: 5d1b24d3c8
am: 65290a9333

Change-Id: I9f649a6b663ca79cab1aa9b9e62a94455f974435
2019-06-29 20:40:50 -07:00
TreeHugger Robot
cfa47f6183 Merge "Call ActivityManagerService.enterSafeMode" into qt-dev 2019-06-30 02:33:16 +00:00
Patrick Baumann
876a733e71 Call ActivityManagerService.enterSafeMode
This fixes the accidental removal (change ID
Ibe849f56f5fe8af1415dc6c85b484d0edca518ec)
of a call to ActivityManagerService.enterSafeMode, ensuring that
when the rest of the device is in safe mode, ActivityManagerService
and PackageManagerService are made aware of it and properly filter
app launches.

Fixes: 129781631
Test: manual; safe mode correctly blocks 3p apps
Change-Id: Ie2caf6d2fd74b241927a245393fb31658201962f
2019-06-28 19:41:04 +00:00
TreeHugger Robot
514085c0aa Merge "Moar SystemServer boot timing improvements:" 2019-06-19 04:49:24 +00:00
Felipe Leme
137e7812f0 Moar SystemServer boot timing improvements:
- Added (optional) constant to log duration of bottlenecks.
- Added TimingsTraceLog.getUnifinishedTraces()
- Added more traceBegin() / traceEnd() statements
- Uses Truth on TimingsTraceLogTest
- Logs total boot duration

Test: manual verification
Test: atest FrameworksCoreTests:android.util.TimingsTraceLogTest

Bug: 133242016
Bug: 132466534

Change-Id: Ib9bb38d357e0d87a9b7da3456c97029a8b0342a3
2019-06-18 18:59:58 -07:00
Zimuzo
ab2fc348fd Pause watchdog triggering on the main thread during package scan
Similar to I3876c41e6d0e41d044a5b1d5e57f894c7fb4fb0e and
I69067fbbb8be4e421918c18b67269044fab51b3e where we pause
the watchdog because dexopting and moving A/B artifacts can take a while,
here scanning packages can take a long time depending on the number of
apps installed on the device.

Bug: 135103243
Test: Manually tested by adding an artificial sleep in
PackageManagerService#main and verified that watchdog was not triggered

Change-Id: Ia5b2b5741194a33f7cd09e79c0904696ce546026
Merged-In: Ia5b2b5741194a33f7cd09e79c0904696ce546026
2019-06-14 16:07:51 +00:00
Zimuzo
e5cc6abdc1 Pause watchdog triggering on the main thread during package scan
Similar to I3876c41e6d0e41d044a5b1d5e57f894c7fb4fb0e and
I69067fbbb8be4e421918c18b67269044fab51b3e where we pause
the watchdog because dexopting and moving A/B artifacts can take a while,
here scanning packages can take a long time depending on the number of
apps installed on the device.

Bug: 135103243
Test: Manually tested by adding an artificial sleep in
PackageManagerService#main and verified that watchdog was not triggered

Change-Id: Ia5b2b5741194a33f7cd09e79c0904696ce546026
2019-06-14 17:03:31 +01:00
Felipe Leme
3aad1be751 Added fine-grained tracing to UserController.startUser()
Also refactored SystemServer.BOOT_TIMINGS_TRACE_LOG into a helper class, so it's not permanently
allocated.

Bug: 133242016
Test: manual verification
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StartInBackground

Change-Id: Id059d4d777bfc705e510d157930aefc7757d8cf8
2019-06-06 10:15:17 -07:00
Zimuzo Ezeozue
1565ff2fbe Merge "Pause watchdog triggering on the main thread during OtaDexoptService" into qt-dev am: fb9843f8d7 am: 9b05627270
am: 99f687fd3d

Change-Id: I7ecf91262c8600afb7a3f6b3ff45fc11ecd90e3a
2019-05-31 09:52:06 -07:00
Zimuzo
f3c4614d1f Pause watchdog triggering on the main thread during OtaDexoptService
Similar to I3876c41e6d0e41d044a5b1d5e57f894c7fb4fb0e where we pause
the watchdog because dexopting can take a while, here moving A/B
artificats can take a long time.

Bug: 134062700
Test: Manually tested by adding an artificial sleep in
OtaDexoptService#main and verified that watchdog was not triggered

Change-Id: I69067fbbb8be4e421918c18b67269044fab51b3e
2019-05-31 12:46:12 +01:00
Winson
4036197d48 Merge "Force system ApplicationInfo update and notify DisplayManager" into qt-dev am: 70e0438d59 am: ad982e23cc
am: 5639e2cf29

Change-Id: I1b36abe72d903e11f2fa168a242e67053252c8cd
2019-05-20 22:03:59 -07:00
TreeHugger Robot
70e0438d59 Merge "Force system ApplicationInfo update and notify DisplayManager" into qt-dev 2019-05-20 19:12:20 +00:00
Hayden Gomes
26705aaead Merge "Removing emulator check for starting BluetoothService" into qt-dev am: 3d622b7016
am: 7de296f82b

Change-Id: I3c95f036487c4b7a9df207e9905b2cd573bfb2a5
2019-05-15 07:41:47 -07:00
Hayden Gomes
013a7f8dce Removing emulator check for starting BluetoothService
This check was intended to be removed once we had the ability to add the
Bluetooth systemFeature check. Removing it now so emulator can enable
bluetooth

Bug: 132627197
Test: Built and ran emulator locally to confirm BTService running
Change-Id: I3e0606e0e4154299e65e5f62d8a1720922d796ad
2019-05-14 18:48:30 -07:00
Zimuzo Ezeozue
db89f1490a Merge "Allow pausing Watchdog on the current thread" into qt-dev am: 3dc28cb1dc
am: 43a000addf

Change-Id: I378242216fcffefd29875eef69487b798ed41a2d
2019-05-14 08:22:37 -07:00
Zimuzo Ezeozue
3dc28cb1dc Merge "Allow pausing Watchdog on the current thread" into qt-dev 2019-05-14 14:55:06 +00:00
Rubin Xu
d0cd4d2e95 Merge "Bump several device admin notifications to high priority" into qt-dev am: c3c30eefb2
am: df396d12ab

Change-Id: I4212fbc4cf9eb3dce1f156f32739f0d80fb66c3f
2019-05-13 04:12:50 -07:00
Rubin Xu
c3c30eefb2 Merge "Bump several device admin notifications to high priority" into qt-dev 2019-05-13 10:30:25 +00:00
William Hester
a47584af34 Merge "Start THM outside of the frp block" into qt-dev 2019-05-10 20:31:04 +00:00
Zimuzo
2a05039b44 Allow pausing Watchdog on the current thread
Since we start the watchdog early during boot, we may have some false
positives where the watchdog thinks a thread is blocked but it
is just running a long task. This cl enables us pause the watchdog
triggering for the current thread and resume the triggering after
the long running task. An alternative would be pausing for a specified
duration without an explicit resume but that may be difficult
to find an upper bound for tasks across all devices.

For now the primary long running task is dexopting which happens on
the main thread during boot. We pause the watchdog triggering on the
main thread and resume afterwards.

Test: Verified with logs that pausing the Watchdog pauses triggering
and resuming resumes triggering
Bug: 132076426

Change-Id: I3876c41e6d0e41d044a5b1d5e57f894c7fb4fb0e
2019-05-10 16:46:38 +01:00
Rubin Xu
897750a79b Bump several device admin notifications to high priority
The following device admin related events now generate interruptive notifications:
1. Admin-triggered remote bug report collections (requires user action)
2. Remote work profile wipe - post wipe notification
3. The enabling of Network logging
4. Admin remotely installs/removes an APK
5. Work profile needs unlocking after boot

Test: manual
Change-Id: If5a51123c05b15e544a31ac7ec6b42ec831a1ccc
Fix: 130623009
Fix: 120770584
Fix: 118810015
2019-05-09 16:35:16 +01:00
Mohammad Samiul Islam
6f5b4d2cee Merge "Revert "Populate active apexes cache in a background thread"" into qt-dev am: 39789e86f7
am: 77a05009c9

Change-Id: I242ba2dd1053cff88958f8b9129d0d1ea9d743d8
2019-05-09 04:57:36 -07:00
Mohammad Samiul Islam
bdccb7501b Revert "Populate active apexes cache in a background thread"
This reverts commit 97fc6d9c29.

Reason for revert: b/132236259

Change-Id: I5270140580ebad16a9dc1db6b2e5f9faa977f54a
Bug: 132236259
2019-05-08 14:44:15 +00:00
William Hester
bbfd15a957 Start THM outside of the frp block
Starting TestHarnessModeService outside of the FRP block will allow OEMs
to provide their own implementation of
PersistentDataBlockManagerInternal in LocalServices, which will allow
them to satisfy all CTS requirements even without supporting Factory
Reset Protection.

Bug: 131439285
Test: make && adb shell cmd testharness enable
Change-Id: If3ea192a22105716cab1dbed832f8c20b51058b7
(cherry picked from commit 87ac4ea4a5)
2019-05-07 22:55:02 +00:00
TreeHugger Robot
2ff05e710b Merge "Start THM outside of the frp block" 2019-05-07 03:19:34 +00:00
William Hester
87ac4ea4a5 Start THM outside of the frp block
Starting TestHarnessModeService outside of the FRP block will allow OEMs
to provide their own implementation of
PersistentDataBlockManagerInternal in LocalServices, which will allow
them to satisfy all CTS requirements even without supporting Factory
Reset Protection.

Bug: 131439285
Test: make && adb shell cmd testharness enable
Change-Id: If3ea192a22105716cab1dbed832f8c20b51058b7
2019-05-06 16:23:47 -07:00
Winson
72dbe7e6f3 Force system ApplicationInfo update and notify DisplayManager
Propagates any changes to the display config made inside any
framework overlay. Notably any display cutout adjustments.

Partial revert of ag/I844de9e09eb1464ae112e1b480d21cf662a026e0
with the OMS method moved into AMS.

Bug: 130444380

Test: manual test with simulated cutout on blueline device
Change-Id: Ifa24954352fa5e92816baa8d669b9abedc4f4ab8
2019-05-06 11:23:52 -07:00