873 Commits

Author SHA1 Message Date
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
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 50e00c8dc48849280410e38bb05a1f11ce24ef01)

Merged-in: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
2018-08-17 16:35:46 -07:00
Neil Fuller
ca48eb7fa9 resolve merge conflicts of bc38909bf3790331532c329a867d5a22fbf94016 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 55c0a6682574b881b0ccdf2b08fdc4b6c84d1b81 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 5e1d95b0cc05eb1a6bf25a13223601f2e8f8fccb 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 feeee682a23f25760c4a1aa07c00945901911ba3)
2018-06-11 15:29:57 +01:00
Neil Fuller
7dbefdcb92 resolve merge conflicts of 26119befba89e1d656e6c2237f15e2b3a74865fd 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 6750352248bcce6668eabd1911d092b7fe31a1cd.

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 2e8afd8736cba3352bcbf585461becb20a7c7600.

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
      d79d203b357b8ac54c36e028d8bb80e3a39165f5

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
Vishnu Nair
3764f4e9f8 Dump input service in bugreport critical section
- input service data needs to be in sync with window service data
- section is generated in under 20 ms well within guidelines

Bug: 74098479
Test: Take bug report and verify contents
Test: mmm -j56 frameworks/native/cmds/dumpstate && \
 adb sync data && adb shell /data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test && \
 printf "\n\n#### ALL TESTS PASSED ####\n"

Change-Id: Ida087fa6b0b2e1509b6d9570ab216bacbb1a1863
2018-03-02 07:56:44 -08:00
Michael Kwan
01ad0aabf2 Add resources and hooks required for custom wear global actions.
Bug: 31802693
Test: manual test
Change-Id: Ie5e2082e2121f6f3a7ca847f40e5cebab52aab0d
2018-03-02 05:53:42 +00:00
Jeff Sharkey
b0613dceb0 Force loading of safe labels in system_server.
It's too easy for code to accidentally use loadLabel() when building
strings for security sensitive contexts, so add ability for a process
to always force loading of safe strings.

Test: builds, boots
Bug: 73657770
Change-Id: I1c7645bd7bebed0cfb6bc3e5bfd36c8cb11d4838
2018-02-28 23:06:04 +00:00
Jeff Sharkey
725024bb2a Merge "Name specific app for rapid data usage." 2018-02-23 16:28:58 +00:00
Jeff Sharkey
e0c2995d0f Name specific app for rapid data usage.
When a single app is responsible for more than half of the data usage
that caused us to trigger a "rapid usage" alert, name that app in the
notification.  Tests to verify.

Move NPMS->NSS direct calls to "Internal" pattern, following
best-practices to avoid unnecessary AIDL exposure.

Remove 3G/4G split mobile plan support, which has been deprecated for
years and was never supported in a shipping product.

Move MultipathPolicyTracker in tree to reflect its package name.

Test: bit FrameworksNetTests:*
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 69263587, 64221505, 73431080, 72746951
Exempt-From-Owner-Approval: approved in previous PS
Change-Id: I3e4ec1ae2222d51b232f76f32faca93d4f8cd272
2018-02-23 16:27:39 +00:00
Yahan Zhou
25d49463d5 Start UsbService in emulator
We need to start usb service in emulator even when we do not have usb
feature. It is used for adb authentication.

BUG: 73644752
Test: manual

Change-Id: I7ac6c5a20777be5ab5f286a02b73211b5e76898d
(cherry picked from commit dfe6a40d8a8d4806d77773961e137edb1fbcbb0e)
2018-02-21 16:01:44 -08:00
Calvin On
3cda1cf7b4 Move WearConnectivityService package.
Test: make checkbuild
Bug: 73355637
Change-Id: Iaef9d3bfc7ed3e94edd9ef742fd183796786697c
2018-02-14 18:26:01 -08:00
Bryce Lee
f19cbe201e Restrict DisplayContent creation.
This changelist limits DisplayContent the display
container/controller creation. All other callpoints now can only
retrieve existing DisplayContents. This removes the chances of
arbitrary calls generating a DisplayContent without the related
ActivityDisplay on the ActivityManager side.

Since display creation is now driven on the ActivityManager side,
the ActivityManagerService must be initialized and associated with
the WindowManagerService before the WindowManagerService can be fully
initialized. This is reflected in changes to SystemServer.

Fixes: 72228411
Test: go/wm-smoke-auto
Change-Id: I8dddb5fc109be4363de5ba87faff9d9885009042
2018-02-09 08:02:00 -08:00
Etan Cohen
9accbba1b7 [RTT] Remove the legacy RTT service
Remove the legacy RTT service. RTT requests are already directed to
the new API by a previous CL.

Bug: 65108579
Test: unit tests
Test: WifiRttManagerTest:test_regular_scan_then_rtt_ranging_stress
Change-Id: I436e8bcd2f4e2ba6056870d887eea141fbebae85
2018-02-07 12:36:05 -08:00
Steve Paik
94292a388c Move CarServiceHelperService (again)
Move CarServiceHelperService.java and ICarServiceHelper.aidl from
frameworks/base to frameworks/opt/car/services.

Bug: 72571496
Test: Complies and runs
Change-Id: I0f09c84e25a372dab3f170bd623f25a92f9b0f73
2018-02-06 11:55:10 -08:00
Jeff Sharkey
bfb43ea9e6 Polished rapid data usage alerting.
Switch to reading limit information from NetworkPolicy, which is
typically populated from SubscriptionPlan.  This lets users have
direct control over the limits we're using to trigger rapid usage
alerts, and makes the feature work without requiring that the carrier
wire up SubscriptionPlan information.

Let the user "snooze" the rapid usage alerting for a day at a time,
so we're less annoying to them.  Send the snooze broadcasts as
foreground, so that we don't re-post notifications while working
through a long background broadcast queue.

Fix notifications to use the "ALERTS" channel, since these alerts
really are higher priority than simple "STATUS" updates; this also
gives us HUN behavior when in full-screen apps.

Update both service and unit tests to work directly with
NotificationManager, instead of the raw AIDL.

Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 72444638, 72436702
Change-Id: I8d9138522a7779cc68eb9fa4777b50facb6567b7
2018-02-03 12:49:30 -07:00
Erik Wolsheimer
640734f43f Unify configs that prevent select services from being run on watches
Bug: 72444680
Test: Manual build and boot
Change-Id: Iea247422a02dbd5fe09b17d85bcdf2a0c6f30233
2018-02-02 08:54:02 -08:00
Abodunrinwa Toki
d32906c202 Introduce a TextClassifierManagerService.
Apps wanting to use a TextClassifier service (instead of an
in-app-process TextClassifier) bind to this service. The service
binds to and reroutes calls to a configured system TextClassifierService.

TextClassifierManagerService manages the lifecycle of the configured
TextClassifierService and binds/unbinds to preserve system health.

A configurable TextClassifierService extends TextClassifierService,
declares an android.textclassifier.TextClassifierService intent, and
requires a permission that is only granted to the system so only the
system may bind to it.

The TextClassifierManagerService implements a similar interface to
TextClassifierService (i.e. ITextClassifierService) but doesn't have to.
This is done for simplicity sake and things may change in the future.

The configuration of the default service is in config.xml.
OEMs may change this with a config overlay.
If no TextClassifierService is specified, the default in app process
TextClassifierImpl is used.

Bug: 67609167
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: tbd
Change-Id: I8e7bd6d12aa1a772897529c3b12f47f48757cfe6
2018-01-29 17:16:21 -08:00
Michal Karpinski
fe4ae0c5b1 Rename RefactoredBackupManagerService to BackupManagerService
The interface will be removed in a subsequent CL, it will be
easier to deal with merge conflicts.

Test: 1) m -j RunFrameworksServicesRoboTests
      2) runtest -p com.android.server.backup frameworks-services
Bug: 65823538
Change-Id: I37c4c6758c646e1b18889ed05aa1b1d7c6129cf0
2018-01-26 10:37:32 +00:00
TreeHugger Robot
c6f994207d Merge "Add pending system update info system APIs." 2018-01-22 20:12:43 +00:00
Tao Bao
07342dc175 Add pending system update info system APIs.
This CL adds system APIs in android.os.SystemUpdateManager. The APIs allow
system updater apps (RECOVERY permission required) to publish the pending
system update information, and allow other apps to query the info
accordingly (requiring RECOVERY or READ_SYSTEM_UPDATE_INFO permission).

Design doc in go/pi-ota-platform-api.

Bug: 67437079
Test: Use test apps to call the new APIs to query and set the update info
      respectively.
Change-Id: Id54b4a48d02922d2abd906dd7e2ec80a656fc9b1
2018-01-18 14:41:41 -08:00
Tony Mak
b0d22627e9 Rename CrossProfileApps API as per API council feedback
Three changes:
1. android.content.pm.crossprofile - > android.content.pm
2. getProfileSwitchingIcon -> getProfileSwitchingIconDrawable
3. startMainActivity “user” parameter should be named “targetUser”

Test: atest FrameworksServicesTests:com.android.server.pm.CrossProfileAppsServiceImplTest
Test: atest frameworks/base/core/tests/coretests/src/android/content/pm/CrossProfileAppsTest.java
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CrossProfileAppsHostSideTest.java

FIXES: 71818128

Change-Id: Icf9a6d1f8b6808935ffd79b43185c7b12235f349
2018-01-18 21:07:50 +00:00
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