Commit Graph

1270 Commits

Author SHA1 Message Date
felipeal
fc5304075e Fixed when SystemServerInitThreadPool.shutdown() is called.
The class' Javadoc says it's shut down after P HASE_BOOT_COMPLETED, whic was
not the case.

Test: manual verification / boot
Fixes: 156257347

Change-Id: I3c8b24c6855c7c83cdf1eacc637b8e064a121fe3
2020-05-11 10:36:59 -07:00
Amy Zhang
6b4b728d8c Start TunerResourceManager when FEATURE_TUNER is supported
Test: make services
Bug: 147380513
Change-Id: I56201db818018b019dfa7d442e3905fba30806d7
2020-05-06 11:58:59 -07:00
Yurii Zubrytskyi
683f2b1acc [incfs] Notify IncrementalService about system startup later
It needs system to be ready to bind to services, which is much
later in the boot process

Bug: 151241369
Test: boot up Android, make sure no error messages from
  IncrementalService trying to bind a DataLoader when the OS
  can't bind services yet
Change-Id: Ibcef3f405965ee07c5b8adbb41f068be734bde9e
2020-04-22 00:39:44 -07:00
Jing Ji
6674e0d654 Set a default wtf handler for system_server at initialization
In case the ActivityManagerService hasn't started yet.

Bug: 153704326
Bug: 153598920
Test: Manual - induce wtf logs in early-booted services
Change-Id: I2b444cf70d9126963084ab15f9cd17fe5b464529
2020-04-17 12:48:08 -07:00
Soonil Nagarkar
1716a62ac1 DO NOT MERGE Move LMS to ease merge conflicts
Cherrypick change from master moving LMS, so that merge conflicts will
be easier to resolve.

Bug: 153568386
Test: presubmits
Change-Id: I8eba22622cc5f4d11c1a928b6cf3883cbf96caba
2020-04-14 12:04:12 -07:00
Calin Juravle
11bdb5dfb4 Merge changes from topic "server-reporting" into rvc-dev
* changes:
  Report SystemServer classpath to PackageManager
  Setup dex load reporter for system server
2020-04-07 18:42:29 +00:00
Florian Mayer
876e06aa97 Make system_server profilable on user.
Test: m with matching SELinux change. profile sys_srv.

This is a cherry-pick of be583be3ed.

Bug: 151140716
Change-Id: I545b758421ea7527d75b5d2756a6b11ae475e7de
Merged-In: I545b758421ea7527d75b5d2756a6b11ae475e7de
2020-04-07 08:46:11 +00:00
Calin Juravle
d75a077d85 Report SystemServer classpath to PackageManager
This will enable us to optimize system server classpath during
idle-maintenance windows.

Test: m
Bug: 148774920
Change-Id: Ibd7641cd10944bb5d7740486d259a412f882cd1f
2020-04-06 12:43:15 -07:00
Calin Juravle
46bddf8e36 Setup dex load reporter for system server
System server may load code at runtime from outside its original
classpath. In order to ensure this code is optimized (verified) we need to
report it to PackageManager which can optimize it during idle-maintenance
windows.

This CL sets up the reporting infrastructure for system server.

Test: atest DexManagerTest
Bug: 148774920
Change-Id: Ibd2ee38857b97bde426ee0a01c60543f1acb8671
2020-04-06 12:43:13 -07:00
Makoto Onuki
a455e5e281 Add WTF when a system server wrapper can't be found
2nd try -- enable it only within the system server.

This is to detect someone trying to access system services too
early during a boot.

Bug: 149406139
Test: Boot with "adb logcat | grep -w SystemServiceRegistry" and make sure no wtf is logged
Change-Id: I64c6776cedaeb534d98621db2955d585e6846b8d
2020-04-01 17:27:58 -07:00
Benedict Wong
ef5732b053 Merge "Automatically set IPsec tunnel interface as up" into rvc-dev 2020-03-31 16:51:58 +00:00
Hall Liu
952697b886 Merge changes from topic "phonestatelistener-limit-rvc-dev" into rvc-dev
* changes:
  Add gating, logging for PhoneStateListener's limit
  Institute limit on PhoneStateListener
2020-03-28 06:48:56 +00:00
Hall Liu
ed6d6e69a8 Add gating, logging for PhoneStateListener's limit
Add gating via PlatformCompat and DeviceConfig and logging via
PlatformCompat to the limit instituted on per-process listeners

Fixes: 152074216
Test: atest CtsTelephonyHostCases
Change-Id: I4d6681d90705b68c3349f4124e434a29b50fd3a2
2020-03-27 19:21:51 -07:00
JW Wang
de4cf91872 Don't reference RollbackManagerService directly (2/n)
This is an effort to modularize RollbackManager.

As we move RollbackManagerService to apex/, SystemServer can't reference
RollbackManagerService directly. Let's use the class name to start the
service.

(Cherry-picked from 41a5d353cc)

Bug: 150347230
Test: m
Merged-In: Ied68ad031f84ea4a416ad779e9ddf4cc912bd7b9
Change-Id: Ied68ad031f84ea4a416ad779e9ddf4cc912bd7b9
2020-03-27 01:36:58 +00:00
Benedict Wong
d78ad3d41a Automatically set IPsec tunnel interface as up
This change makes IPsec tunnel interfaces automatically get brought up
once they are created. Originally this was considered to be an
additional safety check, as they would not be start routing traffic
until explicitly brought up. However, in the intervening time, the
NetworkManagementController now requires the NETWORK_STACK permission to
set an interface as up. Additionally, that call is a hidden API, and
thus not usable for use cases such as IWLAN.

Bug: 149348618
Test: FrameworksNetTests, CtsNetTestCases passing.
Change-Id: I55b63a748463a388e1e2991d2d5d6b3023545e60
Merged-In: I55b63a748463a388e1e2991d2d5d6b3023545e60
(cherry picked from commit 7c5704d177)
2020-03-25 06:14:13 +00:00
TreeHugger Robot
8caff7dc81 Merge "DO NOT MERGE: Remove AppSearch from Android R." into rvc-dev 2020-03-05 21:09:00 +00:00
Songchun Fan
7f051b5251 remove proxy binder service IIncrementalManager
This is no longer needed because native Incremental Service directly
uses IDataLoaderManager.

BUG: 150406132
Test: atest service.incremental_test
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: Idbde2988883becbf3eb707d42c0558774a6073e8
2020-03-04 19:50:44 -08:00
Alexander Dorokhine
0b291791c8 DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538

Change-Id: Idb86be6586ae400552f8ceeca5c667fba8e0c43a
2020-02-25 21:15:03 -08:00
Felipe Leme
6cc15f0468 Set Process' start times for SystemServer.
They're currently 0, because Process.setStartTimes() is only called by
AM when binding to apps.

Test: manual verification
Bug: 141388849

Change-Id: I53fb4d62db06f6758c0e73138993e7d1230ea136
2020-02-25 11:29:52 -08:00
Kevin Chyn
df244da79a Merge changes from topic "biometric-and-credential"
* changes:
  Always start AuthController
  Clean up biometric system server
2020-02-21 21:37:14 +00:00
Kevin Chyn
7d07c89235 Clean up biometric system server
1) BiometricService / AuthService always need to be started, since on
   Android 11 and later, the public credential auth API comes through this
   path.

2) Consolidate getAuthenticatorId() and expose via AuthService. This is
   used only by the platform during key generation. Instead of asking
   each individual service, AuthService will return a list of IDs for
   sensors which are enrolled and meet the required strength.

Test: atest com.android.server.biometrics
Test: fingerprint device, CtsVerifier biometric section
Test: face unlock device, CtsVerifier biometric section
Test: remove biometrics from device, CtsVerifier biometric section

Bug: 148419762
Bug: 149795050

Change-Id: I2c5385b1cd4f343fabb0010e1fe6fb1ea8283391
2020-02-20 11:12:51 -08:00
Anton Hansson
c38998bc5b Stop exposing generated AIDL from Tethering
We don't want new modules exposing stable aidl directly. APIs should
be defined as java @SystemApi. It also seems like nothing actually
depend on these interfaces, except one simple exception.

Bug: 147200698
Test: m
Change-Id: Ia4222fa35a9a2f3c75cebb12f75c536f27e2fe16
2020-02-19 19:03:24 +00:00
Amy Zhang
e891f575a4 Merge "Moving TRM under a separate package Change the TunerResourceManagerListener to ResourcesReclaimListener" 2020-02-18 18:38:38 +00:00
Amy
92726fb752 Moving TRM under a separate package
Change the TunerResourceManagerListener to ResourcesReclaimListener

Test: make framework-media-tv-trm-sources
Bug:
Change-Id: Id49bfead1b08b4d01adb1a3ae9f354da6d1a75b1
2020-02-13 14:20:06 -08:00
Arthur Ishiguro
49e96a8ab7 Fixes Context Hub feature naming and documentation
- Adds "_" in variable name for consistency with feature string
- Adds documentation on what the feature is used for

Bug: 149475852
Test: None
Change-Id: I6eca279df8409de1155cd7014647a705d0d31d6f
2020-02-13 08:08:55 -08:00
Amy
06a551ee7b Add a TunerResourceManagerService as an Android System Serivce.
This service is used to interact with TunerHAL interface and the Tuner
framework to manage the Tuner resources currently used on the device.
Tuner framework claims resource from this service. The service will
handle the requests from multiple applications based on their priority.

Sepolicy changes are in https://android-review.googlesource.com/c/platform/system/sepolicy/+/1161873
Test: cuttlefish
Bug:
Change-Id: Ifedc4e6f120e711aadffdf715d8720e0b64fbe16
2020-02-11 19:39:44 -08:00
Stan Iliev
c90438175f Refactor GraphicsStatsService for updateability
Move GraphicsStatsService to android.graphics package.
Move GraphicsStatsService JNI from libservices.core to
libandroid_runtime.
Declare GraphicsStatsService ctor as the only @SystemApi.
Remove MemoryFile usage from GraphicsStatsService, but use
SharedMemory and other SDK APIs instead. This is done to
avoid using unstable API MemoryFile.getFileDescriptor.
Propose new SharedMemory.getFdDup API for next release, which
is hidden for now.
Refactor statsd puller to avoid proto serialization by moving
data directly into AStatsEventList.
"libprotoutil" is added as a static dependancy to libhwui, which
should be fine because its implementation does not link anything.

Bug: 146353313
Test: Ran "adb shell cmd stats pull-source 10068"
Test: Passed unit tests and GraphicsStatsValidationTest CTS
Change-Id: If16c5addbd519cba33e03bd84ac312595032e0e1
2020-02-07 12:27:07 -05:00
Muhammad Qureshi
e2b2432bc6 Use FrameworkStatsLog instead of StatsLog
As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by
*StatsLog.java
that is autogenerated for each module.
This CL replaces some usages of StatsLog with
FrameworkStatsLog.

Bug: 145952197
Test: m
Change-Id: Iaa2db34a7be4c3215f62cc36661ba8ac81656baa
2020-02-03 09:17:40 -08:00
Sudheer Shanka
d5c6c4a09e Merge "Invoke BlobStoreManagerService.onStart() asynchronously." 2020-02-01 20:41:55 +00:00
Sudheer Shanka
95bd541103 Invoke BlobStoreManagerService.onStart() asynchronously.
Bug: 148299993
Test: atest cts/tests/BlobStore/src/com/android/cts/blob/BlobStoreManagerTest.java
Test: tradefed.sh run google/template/local --template:map \
      test google/continuous/boot-successive  \
      --no-first-boot --successive-boot --boot-count 10
Test: tradefed.sh run google/template/local --template:map \
      test google/continuous/boot-successive \
      --no-first-boot --successive-boot --boot-count 2 --granular-boot-info
Change-Id: I99e3ca1c28a47e6a855c6d61295e9ddb4b4ac29c
2020-01-31 15:22:16 -08:00
Automerger Merge Worker
22a33080d1 Merge "Enable fdtrack in system_server." am: 62d4abfd06 am: 7a3ca3763b am: a27fabe484
Change-Id: I2e560d3a21eb77b970e5589462caf3d989b32d01
2020-01-31 16:57:39 +00:00
Automerger Merge Worker
7a3ca3763b Merge "Enable fdtrack in system_server." am: 62d4abfd06
Change-Id: I7792d474064696ce24dfca47823c73aab79c59f3
2020-01-31 16:42:57 +00:00
Andrii Kulian
e11e951f66 Merge changes from topic "add_bundle_to_window_context"
* changes:
  Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
  Add bundle options to Context#createWindowContext API
2020-01-31 01:16:34 +00:00
Andrii Kulian
e57f2dc246 Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
Replace the existing usages of now-deprecated API
WindowManager.getDefaultDisplay() with WindowMetrics or
Context.getDisplay() in frameworks/base.

Bug: 128338354
Test: Build, auto test
Change-Id: I02d38a022c5e0e6e9d699f03d35b65d6c8126da9
2020-01-31 01:15:21 +00:00
Winson Chung
75f5bf33b0 Merge changes from topic "winscope-sysui"
* changes:
  Add initial SysUI trace support
  Update trace buffer to support SysUI & Launcher
2020-01-29 05:04:48 +00:00
Josh Gao
679f3e4242 Enable fdtrack in system_server.
Spawn a thread that monitors the current fd count, and enables fdtrack
to hunt down leaks when it gets too high.

Bug: http://b/140703823
Test: setprop persist.sys.debug.fdtrack_enable_threshold; stop; start; logcat -c; killall -39 system_server; logcat -d | grep fdtrack
Change-Id: If5831f57d47e6958112abced181f07e18e6a7261
2020-01-28 18:10:55 -08:00
Winson Chung
b53b30cd26 Update trace buffer to support SysUI & Launcher
- Move TraceBuffer to sysui-accessible package, and make it generic
  to support both lite and nano proto callers
- Expose shell command to start/stop sysui tracing

Bug: 144854916
Test: atest TraceBufferTest

Change-Id: Id117024d943f148a91631fd9fcae1fd70fca8ab5
2020-01-27 10:04:58 -08:00
Arthur Ishiguro
c88b3ce7c4 Guard Context Hub Service on Context Hub feature
Also adds annotation to require the feature.

Bug: 147677675
Test: Compile and flash, verify Context Hub Service is not found if the
feature flag is not defined
Change-Id: Ia718c76ec4308274dc66cfe975e762997e3539ca
2020-01-23 14:26:03 -08:00
Sravan Kumar Reddy Kallu
ecc28832ba Merge "Revert "SystemServer: Dynamically load wifi-service"" 2020-01-22 01:32:15 +00:00
Sravan Kumar Reddy Kallu
fba0b26d0f Revert "SystemServer: Dynamically load wifi-service"
Revert "product: Remove wifi-service off SystemServerClassPath"

Revert submission 10103769-load_wifi_service_dynamically

Exempt-From-Owner-Approval: see go/perf-revert-first

Reason for revert: <Regression reported in b/148099857>

Reverted Changes:
I7b658cbfa: SystemServer: Dynamically load wifi-service
I93f2467d0: product: Remove wifi-service off SystemServerClass...

Change-Id: Icc0b680c2c6c472157b7bc9ee7bc7d97a54263c1
2020-01-21 22:31:00 +00:00
Automerger Merge Worker
7a5ca46a94 Merge "Remove an interface before more invasive changes" am: e4a64b4e6b am: 2260679ecd am: 8087607fbc
Change-Id: Ib8d4de706116b2b86e9fb22b8c3466ff22aac9e5
2020-01-21 19:13:40 +00:00
Neil Fuller
2260679ecd Merge "Remove an interface before more invasive changes"
am: e4a64b4e6b

Change-Id: I46f302b0ab055d2c7f826502df09ce8a759db9bf
2020-01-21 10:25:12 -08:00
Hall Liu
6392e2548d Merge "Add system service for accessing SystemConfig" 2020-01-20 21:34:28 +00:00
TreeHugger Robot
fd667a716d Merge "SystemServer: Dynamically load wifi-service" 2020-01-17 16:38:09 +00:00
Tej Singh
250e7aad89 Fix crash when pulling certain atoms
IonMemoryUtil and ProcFsMemoryUtil were package-private classes loaded
in the system server class loader and had the same package as
StatsCompanionService, which is loaded in a separate class loader for
statsd. This caused a crash when statsd tried to access either. This cl
moves IonMemoryUtil and ProcFsMemoryUtil along with StatsPullAtomService
to a separate package so that no classes are shared in the same package.

Bug: 147792532
Test: pulled all relevant atoms and make sure they worked
Test: adb shell cmd stats pull-source 10064
Test: adb shell cmd stats pull-source 10061
Test: adb shell cmd stats pull-source 10042
Test: adb shell cmd stats pull-source 10056
Change-Id: I5107aa47045321e84549a7f2d55d0ee27f0d080e
2020-01-16 15:16:54 -08:00
Roshan Pius
790637e2a4 SystemServer: Dynamically load wifi-service
Bug: 147799672
Test: Device boots up & connects to wifi networks
Test: atest android.net.wifi.cts.WifiManagerTest
Change-Id: I7b658cbfa91e2214bfef50510c648848813f62cc
2020-01-16 14:35:45 -08:00
Gavin Corkery
fd2f68734c Merge "Integrate Rescue Party boot loop logic to Package Watchdog" 2020-01-16 11:12:55 +00:00
Gavin Corkery
aa57ef3e46 Integrate Rescue Party boot loop logic to Package Watchdog
Make Package Watchdog the component that receives calls
about boot events, and decides on whether or not to
perform mitigation action for a perceived boot loop.
The logic for selecting an observer to handle boot loops
is similar to how package failure is handled. The threshold
logic is the same as it was in Rescue Party (5 system server
boots in 10 minutes). Rescue Party maintains its own rescue
levels internally, which map to user impact levels.

Add optional onBootLoop() and executeBootLoopMitigation() methods
to PackageHealthObserver.

Add tests to handle the new cases handled by Package Watchdog.

Test: atest RescuePartyTest
Test: atest PackageWatchdogTest
Bug: 136135457
Change-Id: Ic435e60318e369509975c19a9888741e047803de
2020-01-15 19:20:57 +00:00
Keun young Park
744f97fe20 SystemServer: Migrate Boottime related metrics to StatsLog
Bug: 132691841
Test: check boot related stats are pushed after boot up
      $ adb shell cmd stats print-stats

Change-Id: I675f12b997ae821c75b5aaf456e7c84a2f7fed67
2020-01-15 10:19:19 -08:00
TreeHugger Robot
eacd21542d Merge "Dynamically load statsd-service" 2020-01-15 08:32:54 +00:00