Commit Graph

899 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
f9cca7dcc2 Merge "Move NetworkStack start to AM.systemReady" 2019-03-12 05:27:33 +00:00
Remi NGUYEN VAN
c7054c5e20 Move NetworkStack start to AM.systemReady
In practice the NetworkStack was not started after
ActivityManager#systemReady, since ActivityManager was only scheduling
the start (mPendingStarts).
Requesting the start too early causes issues for the PackageManager to
install updates/rollbacks.

Test: flashed AOSP and internal builds, WiFi working
Bug: 128331883
Change-Id: I93315ad31925bd436e21d1eabb21d5967e6aae60
2019-03-12 04:53:11 +00:00
Nicolas Geoffray
51297d72e6 Remove calls to VMRuntime methods that are no-ops.
Test: m

(Cherry-picked from: 5735cc7a11)
Change-Id: If2e6afe21f6efcb141f3a4428ff9154b68f08a1d
Merged-In: Ibe849f56f5fe8af1415dc6c85b484d0edca518ec
2019-03-05 14:12:19 +00:00
Varun Anand
d33cbc6f5f Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: Id1da446b54d95ee68ed14079107b1a10318bcf8b
Merged-In: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6
2019-03-01 00:10:52 +00:00
Remi NGUYEN VAN
51490ad0fa Merge "Move NetworkStack to services.net"
am: 762f9f0c24

Change-Id: Iab45985aedb8069ad50fd2913ef6e828989cdd0d
2019-02-15 03:01:11 -08:00
Remi NGUYEN VAN
5db454c28d Move NetworkStack to services.net
NetworkStack is only used in services.net or clients of services.net. It
cannot stay in framework.jar because it needs to depend on AIDL
interfaces, which would conflict with app implementations if they were
in framework.jar.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: Ib1d08a3669983640119d008db7e2990fa798724f
Merged-In: I501b125a388c1100c2182bde4670944c2f0d7a02
2019-02-15 12:20:17 +09:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Neil Fuller
963fea9056 Revert "Minimum viable TimeZoneDetectorService"
Remove the stubbed TimeZoneDetectorService. Priorities
dictated that it not be worked on so it has never been
used.

This reverts commit 7fb88c3928.

Bug: 112827764
Bug: 78217059
Test: build / boot
Change-Id: I39ed2fc7f8de8d4b2c0d883cd264cc126579af27
Merged-In: I39ed2fc7f8de8d4b2c0d883cd264cc126579af27
(cherry picked from commit f4894d391b)
2019-02-01 13:21:55 +00:00
Howard Chen
f17f42b0df Add the DynamicAndroid Service
Define the DynamicAndroid with AIDL.
  Add a java implementation.
  Start a service instance in the system server.
  Add a permission test.

Bug: 122015653
Test: Build & Test on a pixel phone with following command \
  ./frameworks/base/services/tests/runtests.py -e class com.android.server.DynamicAndroidTest

Merged-In: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
Change-Id: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
2019-01-31 15:10:21 +08:00
Chris Wailes
6e3c7ced5e Code cleanup to conform to style guide / linter.
This commit made the following changes to make the code conform to the
Frameworks style guide:
* Re-named variables
* Re-flowed code
* Organized includes

Topic: zygote-prefork
Test: make & flash & launch apps
Bug: 68253328
Change-Id: I9274b32f1f606f29f6eb3a1e5068ca18f607afe7
Merged-In: I9274b32f1f606f29f6eb3a1e5068ca18f607afe7
2019-01-23 13:34:52 -08:00
Rene Mayrhofer
40c1196841 Add import of android.provider.Settings
One use case for changing settings during initialization is enabling airplane mode in safe mode bootup.

Test: manual
Change-Id: I846f09faca22b35f502a18348b70800d1edabb60
2019-01-17 08:32:31 -08:00
Rene Mayrhofer
0860f29a1f Enable airplane mode when booting in safe mode
Make it possible to boot in airplane mode when it was not turned on
before shutdown/reboot, either for situations where this is required by
regulation or to work around problems in normal boot. When safe mode is
engaged (Vol-Down), disabled in two stages:
1. Set Settings.Global.AIRPLANE_MODE_ON as early as possible for
   subsystems to react to it during their initialization.
2. Trigger the public ConnectiviyService API to enable airplane mode. This
   has to be done during later stages in initialization because it requires
   sending broadcasts, so some RF leakage may still happen before airplane
   mode is enabled (time window of a few seconds).

Bluetooth is not currently disabled and needs to be fixed by another
change. WiFi and NFC are turned off alongside cellular modems.

Test: manual
Bug: 120145930
Change-Id: I1d61990a9d6f7cd046d28b3e49ecf402dd485063
(cherry picked from commit afc9bc80941ea015cb591a0032e7553b5805fcc6)
2019-01-16 17:09:15 -08:00
Nandana Dutt
3386fb7172 Add a privileged API for capturing and consuming bugreports
The API is mostly implemented; except for hooking up the listener
and handling an already running bugreport.

BugreportManager is the handle to the new API exposed to apps.

Generating bugreports requires root privileges. To limit the footprint
of the root access, the actual bugreport generation in Dumpstate binary,
is accessed as a oneshot service and dies after it finishes
running.

System server accesses Dumpstate via a binder interface since it does
not have root privileges.

Starting a oneshot service is done via setting a system property, which
needs to be done from system server. BugreportManagerService is the
new system server service that does this. BugreportManager calls into
BugreportManagerService via a binder interface, since the former is in
the app's process.

Both app to system server as well as system server to native service
calls are via implementations of IDumpstate binder interface.

Bug: 111441001
Test: builds. Flashed & verified it boots.
Test: wrote a test client (not included) and verified invoking
startBugreport works.

Change-Id: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
Merged-In: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
2019-01-11 13:29:09 +00:00
Chalard Jean
8c141bdb8f [MS01] Add the IP memory store service.
Bug: 116512211
Test: Added initial tests
Change-Id: I9d9af4097e3e2d7afd9956b9cbfa29a9f9558ae0
2019-01-11 15:00:36 +09:00
Remi NGUYEN VAN
9ed654ffab Start NetworkStack on system server start
The network stack will host updatable network components that are being
moved from the system server.

Test: flashed, booted
Bug: b/112869080
Change-Id: I63f98405b69615e7077aed374b8f34a84fb1e4b2
2018-12-26 12:10:17 +09:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Treehugger Robot
9dfd13e7ea Merge "Revert "Revert "Schematize vold system properties""" 2018-12-11 11:04:01 +00:00
Inseob Kim
5b1cc27cee Revert "Revert "Schematize vold system properties""
This reverts commit 2473b08b07.

Reason for revert: Fixed build breakage
sysprop_cpp and sysprop_java directly have been linking against
libprotobuf-cpp-full and do not set proto.type field, which could
cause ASAN error due to linking against both libproto version of full
and lite.

Change-Id: I96eb47444d7b6f6b5fef092efc1514fcdd6f33b6
Merged-In: I8e04f643197b6c8a60cc38c6979e41c5de3469f5
2018-12-11 00:23:07 +00:00
Anthony Stange
6ee45c6f14 Merge "Revert "Schematize vold system properties"" 2018-12-07 12:04:56 +00:00
Anthony Stange
2473b08b07 Revert "Schematize vold system properties"
This reverts commit 7bc31dc162.

Reason for revert: Breaking aosp_master build.

Change-Id: I34a5e9889c17e3454a0a86deabcec3c192a3da52
2018-12-07 11:43:03 +00:00
Treehugger Robot
095d0f640e Merge "Schematize vold system properties" 2018-12-07 01:46:45 +00:00
Inseob Kim
7bc31dc162 Schematize vold system properties
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: I8e04f643197b6c8a60cc38c6979e41c5de3469f5
Merged-In: I8e04f643197b6c8a60cc38c6979e41c5de3469f5
2018-12-05 00:04:24 +00:00
Neil Fuller
ab0b81e921 Add a service for reporting runtime debug info
Add a service for reporting runtime debug info via dumpsys.

With expected OEM customization / module versions in play
it makes sense to have runtime and associated "core library"
information in bug reports. The dumpsys information can also
be used from from host-side tests.

Bug: 119026403
Bug: 118242715
Test: adb shell dumpsys runtimeinfo
Change-Id: I62637a1c8bfd65d5de9b3e47b8700ead4bc314f2
2018-12-03 15:41:50 +00:00
Andreas Gampe
e697a4fc64 Frameworks: Add VMRuntime.hasBootImageSpaces check
Log a wtf in the system server when the runtime does not
use a boot image.

Test: m
Test: system boots
Change-Id: I087c269dd1e95eeeab5db4250133f9c61e9399c7
2018-10-09 11:24:24 -07:00
Rick Yiu
336be26281 Do not start VrManagerService if VR is not supported
When VR mode is not supported by removing the feature of
android.hardware.vr.high_performance, do not start VrManagerService.
Otherwise, there will be undesired behavior, such as calling into
PowerHal/VrHal for VR hints.

Test: no undesired behavior observed
Bug: 116427118
Change-Id: I3e3c1f02c2fad958d8659d7957d005d25d823c3e
Merged-In: I3e3c1f02c2fad958d8659d7957d005d25d823c3e
2018-09-24 12:57:42 +08:00
Adrian Roos
9ee5dff83c BootAnimation: Fix boot animation with hidden cutout
We do this by storing the masking inset in a persistent property.
The boot animation then animates itself to where it would be if that
masking inset were applied, then changes the viewport.

For this to work, we also need to make sure the DisplayManagerService
has the right overlay right at the start.

Bug: 112876936
Test: Hide cutout, then reboot. Verify boot animation is smooth.
Change-Id: I3e988b2340b2e0d2be3939bdc6878704c234ccc8
2018-08-22 21:37:39 +01:00
Makoto Onuki
962f78649f Default to FULL synchronous mode for sqlite DBs in system server
Test: change pin and immediately crash the kernel with
adb shell 'su root sh -c "echo c >/proc/sysrq-trigger"' and boot
Bug: 112175067

Change-Id: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
(cherry picked from commit 50e00c8dc4)

Merged-in: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
2018-08-17 16:35:46 -07:00
Makoto Onuki
3729e9ce4e Default to FULL synchronous mode for sqlite DBs in system server
Test: change pin and immediately crash the kernel with
adb shell 'su root sh -c "echo c >/proc/sysrq-trigger"' and boot
Bug: 112175067

Change-Id: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
(cherry picked from commit 50e00c8dc4)
2018-08-17 21:09:03 +00:00
Neil Fuller
ca48eb7fa9 resolve merge conflicts of bc38909bf3 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ib06f2869e5aa1788c8d5fc281a8565420e93d8f7
2018-06-27 11:40:06 +01:00
Neil Fuller
e01a7adf5a resolve merge conflicts of 55c0a66825 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ie524607cabc6688911eee7e4f61c50fd406c71f4
2018-06-26 11:55:46 +01:00
Neil Fuller
b3d6abbe6f Prepare for migration to the time detector service
Paves the way for moving more behavior to the time detector
service from the NetworkTimeUpdateService.

The NewNetworkTimeUpdateService is effectively identical to
the OldNetworkTimeUpdateService in this initial commit.

Bug: 78217059
Test: build / boot
Merged-In: Ica9fa9b61c849e034d76c0faae5693b60a4a197f
Change-Id: Ica9fa9b61c849e034d76c0faae5693b60a4a197f
2018-06-26 09:46:32 +01:00
Neil Fuller
cccc48d0fe Minimum viable TimeZoneDetectorService
This is a do-nothing TimeZoneDetectorService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeZoneDetectorServiceTest

Test: build / boot
Test: See above
Merged-In: I565fb5dd2f18b7aac2e5779d346bfe69e9da02af
Change-Id: I565fb5dd2f18b7aac2e5779d346bfe69e9da02af
2018-06-21 09:30:34 +00:00
Neil Fuller
79d42a61e4 resolve merge conflicts of 5e1d95b0cc to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ic5527b29cbe8c84d2053be849cf09df5341e4790
2018-06-12 14:23:51 +01:00
Neil Fuller
b557907f51 Minimum viable TimeDetectorService
This is a do-nothing TimeDetectorService that can be
populated in following commits. A temporary method has been
added so the service has one method.

Unit tests can be run with:

atest FrameworksServicesTests:TimeDetectorServiceTest

Test: build / boot
Test: See above
Merged-In: I9e4eac70b944441f34491315cd1ce7fa2b9ae150
Change-Id: I9e4eac70b944441f34491315cd1ce7fa2b9ae150
(cherry picked from commit feeee682a2)
2018-06-11 15:29:57 +01:00
Neil Fuller
7dbefdcb92 resolve merge conflicts of 26119befba to pi-dev-plus-aosp
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Iea64af5a88c9bf399fb26468e931be3c73061bac
2018-06-07 20:02:59 +01:00
Neil Fuller
d2f29d7a6f Remove CommonClock / CommonTimeManagementService
The service and associated code is unused.

Bug: 80462439
Test: build / boot
Merged-In: Ibdfab1b7d2951a0c45e07bd47850af037990841b
Change-Id: Ibdfab1b7d2951a0c45e07bd47850af037990841b
2018-06-06 17:03:55 +01:00
Makoto Onuki
712886fd97 Log slow message delivery on Looper
Sample log:
04-27 15:30:17.306  1000   942   942 W Looper  : Dispatch took 222ms on main, h=Handler (com.android.server.job.JobSchedulerService$JobHandler) {42042fc} cb=null msg=7 start=48162 end=48384
04-27 15:30:17.306  1000   942   942 W Looper  : Delivery took 235ms on main, h=Handler (com.android.server.job.JobSchedulerService$JobHandler) {42042fc} cb=null msg=4 start=48149 end=48384
04-27 15:30:17.773  1000   942   942 W Looper  : Dispatch took 445ms on main, h=Handler (android.app.ActivityThread$H) {5df4c77} cb=android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA@badd538 msg=0 start=48406 end=48851
04-27 15:30:17.828  1000   942   942 W Looper  : Drained
04-27 15:30:24.389  1000   942   942 W Looper  : Dispatch took 718ms on main, h=Handler (android.hardware.soundtrigger.SoundTriggerModule$NativeEventHandlerDelegate$1) {d7e9947} cb=null msg=4 start=54749 end=55467
04-27 15:30:24.389  1000   942   942 W Looper  : Delivery took 621ms on main, h=Handler (com.android.server.media.MediaSessionRecord$MessageHandler) {5851574} cb=null msg=7 start=54846 end=55467
04-27 15:30:24.499  1000   942   942 W Looper  : Drained

Bug: 78590632
Test: Boot and check log
Test: setprop log.looper.1000.android.bg 1 and runtime-restart and check log
Change-Id: Ief1fc65b40b8a3d583879f55a76288e3dba6be7d
2018-04-27 17:15:46 -07:00
Paul Lawrence
54271901cd Fix FDE
Wifi services crash if run during crypto bounce and are
unnecessary. Disable.

Test: Cherry-pick ag/3898232. System boots, can set pattern, system
      reboots. Wifi works at all points.
Bug: 76452634

Change-Id: Id345082f455617386de7fac23fe84e44a8dee6d9
2018-04-13 21:21:45 +00:00
Mehdi Alizadeh
ce2d963d2e Update NetworkScoreService to use SystemService
Bug: 29118511
Test: runtests.sh
Test: Ran integration tests
Test: Verified wifi assistant still works (Uses NetworkScorer).
Change-Id: I50a6bd5ab59fc69fcb331102ad80ec4bb0988c70
2018-04-06 17:08:59 +00:00
Fyodor Kupolov
163a57d71e Merge "Added BinderCallsStatsService" into pi-dev 2018-03-21 23:02:58 +00:00
Alice Sheng
0b08926fcb Merge "Revert "Revert "Add setting for enabling CPU frequency scaling.""" into pi-dev 2018-03-20 21:56:40 +00:00
Alice Sheng
59a9488f50 Revert "Revert "Add setting for enabling CPU frequency scaling.""
This reverts commit 6750352248.

Reason for revert: Added SElinux policy to allow the service to be started. Verified by local testing on the latest pi-wear-dev.

Bug: 74018496
Bug: 75974893
Change-Id: I9bd8939f6292be9c160e19ebdf934023792059ba
2018-03-19 23:46:56 +00:00
Alice Sheng
7723aed494 Merge "Revert "Add setting for enabling CPU frequency scaling."" into pi-dev 2018-03-19 22:38:25 +00:00
Alice Sheng
6750352248 Revert "Add setting for enabling CPU frequency scaling."
This reverts commit 2e8afd8736.

Reason for revert: SELinux Boot crash
Bug: 75974893

Change-Id: I4751530a1b460842130a495efe688aaf19b92638
2018-03-19 22:36:52 +00:00
Alice Sheng
1799f2b878 Merge "Add setting for enabling CPU frequency scaling." into pi-dev 2018-03-19 18:41:40 +00:00
Fyodor Kupolov
ca34851ead Added BinderCallsStatsService
It tracks binder calls into the system server and reports
statistics about CPU time spent per call on multiple dimensions,
e.g. uid or call description.

Usage: dumpsys binder_calls_stats
Overhead: ~0.5% per binder call (if enabled)

Test: manual
Bug: 75318418
Change-Id: I13b854f67f8fd1c9f985b8e45f74dcba2e73b9cb
2018-03-16 23:17:03 +00:00
Yohei Yukawa
b8bbdaf022 Delay DropBox until SettingsProvider becomes ready
It turns out that we are still not ready to publish
DropBoxManagerService at an extremely early boot phase as we attempted
so [1].  Our best right now is to publish DropBoxManagerService
immediatelly after SettingsProvider is installed.

Otherwise, if WTF logs are generated in a too early boot phase, it is
indeed possible that two different instances of SettingsProvider can
be created.

The first SettingsProvider instance, created by the
DropBoxManagerService access to Settings, is still present, and a
reference is held in Settings.ContentProviderHolder, such that
framework API access hits this instance.

The second SettingsProvider instance, created by the SettingsService
startup, also still exists and is referenced by
SettingsService.mProvider -- this instance is hit by "settings" shell
command access via SettingsService.onShellCommand().

This creates a situation where settings modifications made via shell
command cannot be seen by the usual frameworks APIs, and vice-versa.

 [1]: Ie71d53fc125ebc47fa08ef59a8b7e4f66f2e805c
      d79d203b35

Bug: 72399950
Fix: 72450122
Fix: 73505784
Test: atest CtsTextTestCases:android.text.format.cts.DateFormatTest#test_is24HourFormat
Test: atest CtsInputMethodServiceHostTestCases
Test: Manually verified as follows
      1. Boot a certain device that has neither /proc/wakelocks nor /d/wakeup_sources exists
      2. adb shell settings get secure enabled_input_methods
         -> shows non-empty result
Change-Id: I66b68e7f456c4e0e8f5933e65202c61ed862088d
2018-03-14 18:04:52 -07:00
Alice Sheng
2e8afd8736 Add setting for enabling CPU frequency scaling.
Bug: 74018496
Change-Id: I97a6828b6248ae6850e615a4840469420dbaf918
2018-03-13 09:42:08 -07:00
Makoto Onuki
e8edbcf765 Show system uptime in bugreport (dumpsys alarm)
Example:

RuntimeStarted=2018-03-06 19:33:00.587  (Runtime restarted)
Runtime uptime (elapsed): +15s375ms
Runtime uptime (uptime): +15s375ms

Test: dumpsys alarm
Bug: 74126915
Change-Id: I8e82050b8246725d944829b6488b1946a1b37ba1
2018-03-06 13:23:47 -08:00
TreeHugger Robot
3b346fa9b1 Merge "Add resources and hooks required for custom wear global actions." 2018-03-02 21:32:34 +00:00