Commit Graph

14260 Commits

Author SHA1 Message Date
Dongwon Kang
569da9ff5a Add MediaUpdateService in SystemServer
Test: play mp4 file and install & uninstall media update apk.
Bug: 67908547
Change-Id: I17f91a85994da9a43e08734f7e79311bee62eab1
2018-01-12 18:02:49 -08:00
Fyodor Kupolov
7fcd659705 Enabled SQLiteCompatibilityWalFlags class
In system_server, it should be deactivated until InstallSystemProviders
is finished.

Test: SQLiteCompatibilityWalFlagsTest
Test: setting put global ... + verify that dumpsys dbinfo has the new flag
Bug: 70226732
Bug: 70517616
Change-Id: Iec6a5e61a5d7e4cc0ac602f2b630357c54bb4456
2017-12-15 17:34:52 -08:00
bohu
91f757b50c Check wifi feature before starting wifi service
Otherwise, Wifi service could crash SystemServer;
for example, on emulator system image where wifi
feature is missing, starting wifi will cause boot
failure.

BUG: 70378659

Change-Id: I82546c2c63fb6736e8216a7942fba2d3c9affb13
2017-12-12 23:01:44 -08:00
Jason Monk
8f5f7ff5fa Add system service for slices
Will be used to manage permissions and possibly pinned state for slices.

Test: manual
Change-Id: Ie53f4988f817ac5b920087567dbac751e2857dbf
2017-12-05 13:37:37 -05:00
Fyodor Kupolov
a81b8c0932 Provide remote stack trace information
The stack is truncated up to 5 lines at parcel time. When unparceling,
a separate RemoteException will be created and set as a cause of the
exception being thrown.

Performance results(in nanoseconds):
timeWriteExceptionWithStackTraceParceling  4168
timeWriteException                         2201
timeReadException                         15878
timeReadExceptionWithStackTraceParceling  23805

Test: manual + ParcelPerfTest
Bug: 36561158
Change-Id: I18b64a6c39c24ab067115874ddb5bd71f556a601
2017-11-14 14:31:32 -08:00
TreeHugger Robot
3bba35111e Merge "Introduce CrossProfileApps API" 2017-11-13 06:43:44 +00:00
Christine Franks
69dde2ed8d Merge "Rename NightDisplayController and -Service" 2017-11-09 17:50:11 +00:00
Ricky Wai
1a6e667cb6 Add Network security watchlist service
Network security watchlist service is a service to monitor all potential
harmful network traffic. By setting a network watchlist, any connections
that visit any site from watchlist will be logged.

Logs will be aggregated everyday and encoded using differential
privacy before exporting it from framework.

This feature is disabled now, run "setprop ro.network_watchlist_enabled true" to enable it.

All network events are handled in an async bg thread, it should not
cause any delay in netd. Also, it uses the hooks in enterprise network logging,
so we can run netd_benchmark to measure the impact to netd.

Here are the things not included in this CL:
- ConfigUpdater to get and set watchlist
- Differential privacy encoding logic and reporting
- CTS
- Memory and performance optimization for internal watchlist data structure

Test: manual - turn on the feature, hard code a watchlist xml, process
that visited that domain is being logged in sqlite.
Test: run netd_benchmark - seems no obvious performance change.
Test: bit FrameworksCoreTests:android.net.NetworkWatchlistManagerTests
Test: runtest frameworks-net
Test: runtest frameworks-services -p com.android.server.net.watchlist

Bug: 63908748

Change-Id: I09595178bac0070a867bc5e0501a7bf2c840e398
2017-11-08 18:57:46 +00:00
Christine Franks
5397f0353a Rename NightDisplayController and -Service
Bug: 68258004
Test: make -j100 && runtest -x
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
&& runtest -c com.android.server.ColorDisplayServiceTest
frameworks-services
Change-Id: I2b89942bd412e4d6958e65b62bc345fb1e60176f
2017-11-08 10:29:01 -08:00
Jeff Sharkey
8918298045 Narrower StrictMode defaults.
Until now, userdebug and eng builds have tracked StrictMode
violations on all system apps, including prebuilts that we have no
control over, which results in a lot of unactionable noise.

This CL narrows the set of enabled apps to only "bundled" system
apps, which gives us a much higher chance of burning these violations
down to 0 and keeping them there.  We don't have a good proxy for an
app being "bundled", so we detect it based on being in the "android."
or "com.android." package namespace.

Clean up the entire flow of applying StrictMode defaults to make it
much more human-readable.  This resulted in us fixing a bug where
StrictMode was never actually enabled for jank-sensitive threads in
system_server!

Relax I/O checks in a few places where we know we're interacting with
procfs or sysfs.  Add internal "allow" methods that avoid object
allocation by returning raw mask.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Bug: 68662870
Change-Id: I536e8934fbcdec14915fcb10995fc9704ea98b29
2017-11-03 17:36:35 -06:00
TreeHugger Robot
f9ba65ac52 Merge "Switch display control betw. Android and Sidekick" 2017-11-03 21:49:54 +00:00
TreeHugger Robot
d906cc0901 Merge "Revert "SystemServer: spawn hwbinder threads before BatteryService"" 2017-11-03 21:23:48 +00:00
Chris Phoenix
bc839a3957 Switch display control betw. Android and Sidekick
Test: builds; Sidekick animates watch faces
Change-Id: I6ef1e91ed33b1790eed9a7b9af9bc6b6441c7de9
(cherry picked from commit 40f6f257f537b270be06a09a959202260cb53267)
2017-11-03 16:27:29 +00:00
Yifan Hong
6f7a9e13a4 Revert "SystemServer: spawn hwbinder threads before BatteryService"
This reverts commit 889902c9f9.

Reason for revert: b41e87ae680beefd0d39a127d1ea0b2614caa5f9 fixes 
the root issue. Revert the workaround.

Change-Id: I2f5dfaee8bda17b1d6aeb8418b4a64084b6a6b56
Test: multiple boots
Bug: 68785531
Bug: 68765551
2017-11-02 20:58:11 +00:00
Narayan Kamath
daca7ce5e7 Merge "SystemServer: Get rid of some unused config.* knobs." 2017-11-02 10:22:20 +00:00
Yifan Hong
889902c9f9 SystemServer: spawn hwbinder threads before BatteryService
BatteryService is the first service that uses a hwbinder
call, so we need to spawn the threads for BatteryService to receive
callbacks prior to starting BatteryService.

Test: boot test
Test: manually sleep in SensorDeviceUtils, still boots

Bug: 68765551
Bug: 68217725

Change-Id: Iadd88897d4cf9e0e37af706452c15318115f2149
2017-11-02 04:34:08 +00:00
Tony Mak
1b708e68b3 Introduce CrossProfileApps API
CTS will be in next CL.
APIs for labels/ icons of profile switching are not implemented yet.

Test: Wrote a test app to play around the APIs
Test: bit FrameworksServicesTests:com.android.server.pm.crossprofile.CrossProfileAppsServiceImplTest
BUG: 67765768

Change-Id: I27714aa4a8d61c6df398cbc5112cb4c35316a3fb
2017-11-01 10:11:51 +00:00
Narayan Kamath
1c888f6d44 SystemServer: Get rid of some unused config.* knobs.
They are untested and were committed as part of a legacy refactoring
that appears incomplete.

The Wear team have added a few new config.* flags to disable services
they don't need on watches. These should probably be unified since we
don't really need this fine level of granularity.

Test: make & flash
Bug: 64052650
Change-Id: I5c8ed3f0e78c2ed0d2e733939a82e1ab8940de22
2017-10-30 14:35:15 +00:00
TreeHugger Robot
4b34000a21 Merge "Add proto dump flag to services (2/2)" 2017-10-26 23:45:46 +00:00
Vishnu Nair
e78b01ad2d Add proto dump flag to services (2/2)
Adds new PROTO flag which requests services to dump sections in proto format. Modifies PriorityDumper helper class to parse proto arguments and set asProto flags. Registers WM and AM with proto dump supprt.

Bug: 67716082

Test: frameworks/base/services/tests/runtests.py -e class "com.android.server.utils.PriorityDumpTest"
Test: adb bugreport ~/tmp/bug.zip
Test: adb shell dumpsys window --proto
Test: adb shell dumpsys activity --proto

Change-Id: Icfc6857c8a9340110a43343734a27e48d0b5a229
2017-10-26 10:11:54 -07:00
Vishnu Nair
5c010903b1 Register ConnectivityService with dumpsys priorities
Register service with HIGH and NORMAL priority suppport. Dump network diagnostics as part of the HIGH priority bucket.

Test: adb shell setprop dumpstate.version "2.0-dev-priority-dumps" && \
                adb bugreport ~/tmp_new.zip
Test: adb shell dumpsys --priority HIGH

Change-Id: I1ad263efbc264c3328e70dc9f7ddeb2d31bc4d41
2017-10-26 10:08:50 -07:00
Max Bires
ffac772f92 Revert "Removing stats service registration in system server"
This reverts commit 5b1c33e45f.

Change-Id: I4958b8e466a15b0dbaaa21ddcd592caa479d1850
2017-10-23 22:59:10 +00:00
Max Bires
5b1c33e45f Removing stats service registration in system server
Introduced in ag/2837473, this stats service is not actually up and
running fully. It is creating boot time selinux denials due to lack of
permissions for system server to start the service. Since it cannot run
due to system server being unable to register it with servicemanager, the
registration code is being removed for now to clean up boot denials.

Removing this boot denial will allow boot-time presubmit tests for SELinux to be
put into place. Service definition and sepolicy for this feature can be
added when the feature is approved in the future.

Bug: 67468181
Test: servicemanager does not generate denials on boot
Change-Id: Id6a29cc6abb8ebf5a3f41da4311a555f41dd80b3
2017-10-20 12:49:48 -07:00
TreeHugger Robot
2d3365e1ae Merge "Start IoT System Service from SystemServer" 2017-10-19 18:47:02 +00:00
Daichi Hirono
edfcb00fda Add config resource to specify device specific services
The new string resource contains class names of device specific services
and referred by SystemServer.java.

Bug: 63893131
Test: Manually added device specific service and see if it's launched
Change-Id: I0cf88de5dfcf86dad459c0909073dce7fbfa57b9
2017-10-18 09:38:52 +09:00
Nick Felker
1bfe59d179 Start IoT System Service from SystemServer
For feature type "embedded", launch IoTSystemService from
System Server.

Test: Wrote a IotSystemService and ensured that the service is
successfully started on an iot device.

Bug: 67641069
Change-Id: I5aa0408f35fb4a5b0787cf9b20454720d8ae130f
Cherry-picked and refactored from oc-iot-dev branch
2017-10-14 00:07:33 +00:00
Vishnu Nair
e9852f5245 Register wm, am, cpuinfo, meminfo services with dumpsys priorities
Register services to be called as soon as a bug report is taken so relevant debug info can be captured.

dumpsys --priority CRITICAL times: adb shell dumpsys --priority CRITICAL | grep "was the duration"
0.005s was the duration of dumpsys SurfaceFlinger
0.002s was the duration of dumpsys cpuinfo
0.003s was the duration of dumpsys activity
0.025s was the duration of dumpsys window

Bug: 31774394

Test: adb shell setprop dumpstate.version "2.0-dev-priority-dumps" && \
                adb bugreport ~/tmp_new.zip
Test: adb shell dumpsys --priority CRITICAL
Test: adb shell dumpsys --priority HIGH
Test: adb shell dumpsys --priority NORMAL
Change-Id: Ic656a05dd9a838f0b13043b4387dae7b5c691f7e
2017-10-11 18:09:55 -07:00
Fyodor Kupolov
c56106a13e Crash if not all privileged permissions are whitelisted
Test: reboot device - no crashes
Test: Ran privapp_permissions.py for fugu/marlin/taimen
Bug: 64693550
Change-Id: I9522ccaa75858b9a3d153c95c529eff70cd13994
2017-10-09 14:27:47 -07:00
Etan Cohen
5b8273e465 Merge "[RTT2] Add API for testing whether feature exists on platform" 2017-10-03 20:14:31 +00:00
TreeHugger Robot
dffe6733b2 Merge "Improve handling of devices without a WebView." 2017-10-03 19:35:06 +00:00
TreeHugger Robot
48ffde7ed0 Merge "[RTT2] New (v2) Wi-Fi RTT framework" 2017-10-03 15:48:31 +00:00
Torne (Richard Coles)
ff937ac226 Improve handling of devices without a WebView.
Use the presence of FEATURE_WEBVIEW to determine whether a device is
intended to have a WebView implementation or not, instead of trying to
fall back to NullWebViewFactoryProvider after loading WebView fails.
This removes the need for nullwebview entirely, and eliminates a class
of possible bug where unexpected exceptions during loading cause the
fallback mechanism not to work reliably.

On devices which don't have the feature, don't start
WebViewUpdateService at all. Guard all the places which try to access
the service to return reasonable (empty/null) results when this is the
case, instead of throwing exceptions.

Change-Id: I839adaaf0abee28f4989e3fbc0c49c0732d0ec1c
Bug: 31849211
Fixes: 28529980
Test: on wear and non-wear, cts-tradefed run cts -m CtsWebkitTestCases
2017-10-03 10:40:20 -04:00
Etan Cohen
692e68e7a2 [RTT2] Add API for testing whether feature exists on platform
Add PackageManager API which allows apps to test whether the platform
officially supports the Wi-Fi RTT API.

Only start the RTT service if the device supports it.

Bug: 65014628
Test: integration tests pass
Change-Id: Ie88bd29ccd592e9a29ff24e8cc346afc360f03b0
2017-10-03 07:01:05 -07:00
Etan Cohen
17ba47254c [RTT2] New (v2) Wi-Fi RTT framework
Replace existing Wi-Fi RTT manager framework. Creating new framework
in parallel since there's code using the new framework - will be
switched over once new version ready.

New version is AIDL-based.

Bug: 65014552
Test: unit tests and integration tests
Change-Id: Id468c9b2a3c94eb30959f5ac5e4b1688fb8fc633
2017-10-03 07:01:01 -07:00
Michal Karpinski
bef5f4a64f Switch to use RefactoredBackupManagerService
Keeping the legacy BackupManagerService for now, but we'll remove
it in a few weeks if there's no issues noticed.
In case of any problems, this CL can be cleanly reverted as a fallback.

Test: pretty much all we got in store
1) runtest -p com.android.server.backup frameworks-services
2) make gts -j40 && gts-tradefed run gts -m GtsBackupHostTestCases
3) make cts -j40 && cts-tradefed run cts -m CtsBackupTestCases
4) make pts -j40 && pts-tradefed run pts -m PtsBackupHostSideTestCases
5) manual: "adb shell bmgr backupnow --all" and then cloud restore,
   D2D scenarios (both as source and target)
Bug: 65823538
Change-Id: I701764995c4fe2611a4941aecb45315aa457658e
2017-09-28 14:10:56 +01:00
Nathan Harold
7bbe9c70f3 Re-Enable Starting of the IpSecService am: b72821747c am: f434a6d308 am: 686a8282bb
am: 458b8cd302

Change-Id: Ic492c58b8c9b56f870c99336e82fd8d05c9e8969
2017-09-26 22:48:25 +00:00
Nathan Harold
458b8cd302 Re-Enable Starting of the IpSecService am: b72821747c am: f434a6d308
am: 686a8282bb

Change-Id: Ia24348d585b2f1050dafd161eafcdadf0edd82c0
2017-09-26 22:37:44 +00:00
Nathan Harold
f434a6d308 Re-Enable Starting of the IpSecService
am: b72821747c

Change-Id: I1f64aa2fdf1cce6dea91427eda65c4b8ee6f6b02
2017-09-26 22:11:58 +00:00
Adam Bookatz
43b272e20c Merge changes I82fe220e,Iff324c73,I3bd73acd
* changes:
  indexed priority queue for AnomalyMonitor
  StatsCompanionService connection to Statsd
  Set up StatsCompanionService.java
2017-09-20 14:01:49 +00:00
Neil Fuller
8acdb8aa65 resolve merge conflicts of 83c367aa5b to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ia3dc2e0b10bbf5be9c7d8f98b03cf8030bbfff07
2017-09-20 13:43:28 +01:00
Neil Fuller
933845c480 Fix reliability triggering
Fix reliability triggering in the time zone update
feature. The reliability triggering is there to
resume an update check when things go wrong. For
example, if the device is turned off after a
time zone data app is updated but before the time
zone update process has finished pulling the data
out and installing it in /data. The reliability
trigger happens when the device is idle and will
complete the work.

The idle triggering currently doesn't work as it
was implemented incorrectly.

The code has been changed to use the
JobScheduler to trigger on idle and scheduling
has been made explicit.

Unit tests run with:

make -j30 FrameworksServicesTests
adb install -r -g \
  "out/target/product/marlin/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
adb shell am instrument -e package com.android.server.timezone -w \
  com.android.frameworks.servicestests \
  "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Test: See above
Test: Manual testing: adb shell am idle-maintenance, adb logcat/adb shell dumpsys timezone
Test: PTS: run pts -m PtsTimeZoneTestCases
Bug: 65657543
Change-Id: Ibb2c537955d09a5d538c50490dae94a518522f19
Merged-In: Ibb2c537955d09a5d538c50490dae94a518522f19
(cherry picked from commit cd1a109b87)
2017-09-19 16:12:57 +00:00
Neil Fuller
782a79f47a Fix reliability triggering
Fix reliability triggering in the time zone update
feature. The reliability triggering is there to
resume an update check when things go wrong. For
example, if the device is turned off after a
time zone data app is updated but before the time
zone update process has finished pulling the data
out and installing it in /data. The reliability
trigger happens when the device is idle and will
complete the work.

The idle triggering currently doesn't work as it
was implemented incorrectly.

The code has been changed to use the
JobScheduler to trigger on idle and scheduling
has been made explicit.

Unit tests run with:

make -j30 FrameworksServicesTests
adb install -r -g \
  "out/target/product/marlin/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
adb shell am instrument -e package com.android.server.timezone -w \
  com.android.frameworks.servicestests \
  "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Test: See above
Test: Manual testing: adb shell am idle-maintenance, adb logcat/adb shell dumpsys timezone
Test: PTS: run pts -m PtsTimeZoneTestCases
Bug: 65657543
Change-Id: Ibb2c537955d09a5d538c50490dae94a518522f19
Merged-In: Ibb2c537955d09a5d538c50490dae94a518522f19
(cherry picked from commit cd1a109b87)
2017-09-19 17:10:46 +01:00
TreeHugger Robot
2780e401c6 Merge "Fix reliability triggering" 2017-09-19 15:36:52 +00:00
Neil Fuller
cd1a109b87 Fix reliability triggering
Fix reliability triggering in the time zone update
feature. The reliability triggering is there to
resume an update check when things go wrong. For
example, if the device is turned off after a
time zone data app is updated but before the time
zone update process has finished pulling the data
out and installing it in /data. The reliability
trigger happens when the device is idle and will
complete the work.

The idle triggering currently doesn't work as it
was implemented incorrectly.

The code has been changed to use the
JobScheduler to trigger on idle and scheduling
has been made explicit.

Unit tests run with:

make -j30 FrameworksServicesTests
adb install -r -g \
  "out/target/product/marlin/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
adb shell am instrument -e package com.android.server.timezone -w \
  com.android.frameworks.servicestests \
  "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Test: See above
Test: Manual testing: adb shell am idle-maintenance, adb logcat/adb shell dumpsys timezone
Test: PTS: run pts -m PtsTimeZoneTestCases
Bug: 65657543
Change-Id: Ibb2c537955d09a5d538c50490dae94a518522f19
2017-09-19 13:31:12 +00:00
Jeff Sharkey
54402795b7 Destroy vold socket interface completely.
Long live Binder.

Test: yes
Bug: 13758960
Change-Id: I08e8c513b1dea217d64d06e9d8bec6171c8afdaf
2017-09-18 16:00:33 -06:00
Nathan Harold
b72821747c Re-Enable Starting of the IpSecService
This reverts commit 41004ff411.

Bug: 64800246
Test: compilation
Change-Id: I4f5e3cd23001b9d94b3f6dc9fcfe731a90650e6e
2017-09-12 19:25:09 -07:00
Bookatz
9472641287 Set up StatsCompanionService.java
Introduces StatsCompanionService.java and sets it up as a system service.

This service is a helper for statsd. It will be responsible for setting
and cancelling alarms related to polling stats and anomaly detection.

It currently does not have selinux permission, so must be started
manually (or with selinux temporarily disabled).

Test: disable enforcing selinux, then set and cancel alarms and make
sure they work.

Change-Id: I3bd73acdd998ee424696cce40965134c14220d8f
2017-09-12 14:56:54 -07:00
Dianne Hackborn
477c364819 Merge "Fix issue #65055576: VoiceInteractionManagerService sets..." into oc-mr1-dev am: 9d484f015f
am: 7bba649352

Change-Id: I8c97bc1d29dcff6c2a4cafe0ff649d725b1f2266
2017-08-31 18:31:24 +00:00
Dianne Hackborn
31cb01d5dd Fix issue #65055576: VoiceInteractionManagerService sets...
...VOICE_RECOGNITION_SERVICE that is needed for SearchSpeechServices

System setup was incorrectly completely runing off
VoiceInteractionManagerService if the associated feature is not set,
but the service needs to always be running, and instead rely on
the existing logic of reducing functionality if it should not be
running full voice interaction services.

Test: manually booted and ran
Bug: 65055576

Change-Id: I9a83216d45689440c71d657ba2721faf0662b0ff
2017-08-31 10:21:22 -07:00
Roger 1 Jönsson
db4eeb5e0f Merge "Create new trace object when logging from new thread" into oc-mr1-dev am: 071edf5b09
am: 1decec5937

Change-Id: Ie2cb8e2553937eb78f2644ff7f49defe73d147e5
2017-08-25 23:22:29 +00:00