Commit Graph

14716 Commits

Author SHA1 Message Date
Roshan Pius
f061a709b6 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
(cherry picked from commit 7e6f5f5e08)
(cherry picked from commit b51c428f41)
2019-08-23 19:04:48 +00:00
Roshan Pius
15b5a03ef6 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.
(cherry-picked from 7e6f5f5e08 & applied
aosp/977048)

Change-Id: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
2019-08-23 10:40:07 -07:00
Anna Trostanetski
911c6ffd6a Merge "Start platform compat service eariler." into stage-aosp-master am: 4535b04b33 am: f3fe588229
am: 0755524354

Change-Id: Ic4c4d904df1484844fbaea740674ace0be1d0491
2019-08-20 02:53:39 -07:00
Anna Trostanetski
f3fe588229 Merge "Start platform compat service eariler." into stage-aosp-master
am: 4535b04b33

Change-Id: Ie41d2286e869bf84362919a183f4bad348dfc945
2019-08-20 02:25:13 -07:00
atrost
499d4bff66 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.
Bug: 137769727

Change-Id: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
Merged-In: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
2019-08-19 16:10:47 +00:00
atrost
8266ae32ba 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.
Bug: 137769727
Change-Id: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
Merged-In: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
2019-08-19 16:10:31 +00: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
Felipe Leme
b27cd42b1a Merge "Don't start intelligence services that are not provided by the OEM." into qt-qpr1-dev
am: 4e8070890a

Change-Id: Iba93086430c52c23828d0899b1440b1724e14d81
2019-08-13 15:50:33 -07: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
496638bb04 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

Merged-In: I07f9873a7ad0c6dd1c1a0d6a0e5e05681bfc67fc
Change-Id: I07f9873a7ad0c6dd1c1a0d6a0e5e05681bfc67fc
2019-08-09 09:09:01 -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
359a9d999b [DO NOT MERGE] 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 22:26:05 +00: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
Svet Ganov
09658011eb [DO NOT MERGE] Don't drop restricted permissions on upgrade
am: 0b41c8940a

Change-Id: I0a32e4481ffd026c8a338b1500f70109983b21a5
2019-07-27 21:41:56 -07:00
Svet Ganov
0b41c8940a [DO NOT MERGE] 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
2019-07-27 19:28:43 +00:00
Andrei Onea
4fd8dabd52 resolve merge conflicts of 130e0ade7b to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ie8cfba397930a1bd5ec947f4834478bb629fa640
Merged-In: I19e5fbfefcf59e0b53b197ea8e9e3cb78439b4c4
2019-07-25 18:17:30 +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
Andrei Onea
6cd9d4d18e 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
Merged-In: I19e5fbfefcf59e0b53b197ea8e9e3cb78439b4c4
2019-07-25 12:38:04 +00:00
Andrei Onea
df301b8887 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
Merged-In: I19e5fbfefcf59e0b53b197ea8e9e3cb78439b4c4
2019-07-25 10:58:53 +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
Patrick Baumann
a848a8ec14 Call ActivityManagerService.enterSafeMode
This fixes the accidental removal (change ID
If2e6afe21f6efcb141f3a4428ff9154b68f08a1d)
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: 137052912
Test: manual; safe mode correctly blocks 3p apps
Change-Id: Ie2caf6d2fd74b241927a245393fb31658201962f
Merged-In: Ie2caf6d2fd74b241927a245393fb31658201962f
2019-07-12 19:51:06 +00:00
Neil Fuller
8f8f4da0ca Merge "Remove the ability to turn off TimeDetectorService"
am: 71fd6f0113

Change-Id: I8b32782038657c504d30a2c4b1db1c4985546ed3
2019-07-03 17:20:50 -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
Neil Fuller
e9efed97f7 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
Merged-In: Iad7ff59b19fa54750831819c68b7b733e5763902
Change-Id: Iad7ff59b19fa54750831819c68b7b733e5763902
2019-07-02 12:04:24 +00: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