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: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6
Added 3 more system props:
- sys.system_server.start_count
How many times the system server has started, 1-based.
- sys.system_server.start_elapsed
Elapsed time when the system server started most recently
- sys.system_server.start_uptime
Uptime when the system server started most recently
Also log the same information on event log, as 'system_server_start'.
Bug: 124022170
Test: manual
$ adb logcat -b events -s system_server_start
02-15 23:35:06.151 1222 1222 I system_server_start: [1,4714,4714]
(killed the system server)
02-15 23:35:24.673 4209 4209 I system_server_start: [2,23236,23236]
$ getprop | grep system_server
[sys.system_server.start_count]: [2]
[sys.system_server.start_elapsed]: [23236]
[sys.system_server.start_uptime]: [23236]
Change-Id: Ie3e77903e723eb5b7e79b545d4287d9b07c4b379
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.
(cherry-pick of aosp/905233 with trivial conflicts in SystemServer.java)
Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: I501b125a388c1100c2182bde4670944c2f0d7a02
This reverts commit 54271901cd.
Wifi service is assumed to be always up by other parts of the Android
system. So, not starting wifi service will cause NPE crashes all over
the place.
Wifi service already goes into idle mode to handle this FDE transition,
so there is no need for it to be turned off.
Bug: 78663946
Test: Manually verified non-FDE to FDE transition on Taimen (Using
ag/6180881).
Change-Id: I2d4d38e978a671f4dcd671524a1b38f557510bf5
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
Change-Id: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
GPU Service is used to monitor all GPU and graphics driver related features.
This patch implements GPU service into System Server, and implements
functionality to extract the whitelist out of game driver package when the
package is upgraded or removed. This will move the whitelist processing off
critical path when app launches.
BUG: 123290424
Test: Build, flash and boot. Verify by upgrading game driver apk.
Change-Id: I563a138bfe0c4c1bb17ed28dab5d6a8df244021d
It is a helper in the system process that helps dumpstate and incidentd get
user confirmation to share reports
Bug: 123543706
Test: bit GooglePermissionControllerTest:*
Change-Id: Ia3fe4bd5257044ed89fe56ce683876fa03ba6c36
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
- Register a role observer in VoiceInteractionManagerService. Once the
role is changes map the new role setting onto the old settings.
- As the assistant role is now always set, there is no need to have code
in AssistUtil for the case the assistant setting is not set
- Remove old config option for the default assistant. The default
assistant is not configured via the roles config
Bug: 110557011
Test: - Set, unset and swtiched assistant via the settings UI
- for voice interaction service
- for assist activity
- Booted from freshly wiped device and saw assitant to be set to
default
Change-Id: I8596f49c6f6496e8b70cf3236aaa7d7557443a93
go/heapprofd is a native heap profiler for android Q+. Its triggering is
implemented within /bionic/libc. App processes (i.e. zygote children) are not
considered profileable by default on "user" builds. To opt-in into being
profileable, the app's manifest needs to have the Q+ go/profileable flag set
(or be marked as debuggable, which is its superset).
With this change, if the app is supposed to be profileable, post-fork runtime
init calls into bionic to mark itself as such, and possibly start "from
startup" profiling.
On userdebug, all zygote children are marked profileable via the same
mechanism. System server is also marked profileable on userdebug (and needs a
separate codepath, as it does not have an activity thread).
See go/heapprofd-java-trigger for details on why we're taking this approach.
Context on the profiler itself: go/heapprofd-design.
Test: flashed blueline-userdebug, confirmed that java profiling activates from startup and at runtime.
Test: flashed crosshatch-user, confirmed that no java profiling is enabled by default.
Bug: 120409382
Change-Id: Ia038871acfa6b9cae7b6a81f666aecce4b68a4fc
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
Test Harness Mode is a feature for device farms that want to wipe
their devices after each test run. It stores the ADB keys in the
persistent partition (used for Factory Reset Protection) then performs
a factory reset by broadcasting the MASTER_CLEAR intent.
Upon rebooting, the Setup Wizard is skipped, and a few settings are set:
* Package Verifier is disabled
* Stay Awake While Charging is enabled
* OTA Updates are disabled
* Auto-Sync for accounts is disabled
Other apps may configure themselves differently in Test Harness Mode by
checking ActivityManager.isRunningInUserTestHarness()
Bug: 80137798
Test: make && fastboot flashall -w
Test: adb shell cmd testharness enable
Change-Id: I91285c056666e36ad0caf778bffc140a0656fcfa
This service will let the system know whether the user is paying attention to
the device. This may be useful in certain scenarios - like keeping the screen
on, even when there has been no touch related user activity.
New permission BIND_ATTENTION_SERVICE is added to ensure that only the system
can bind to the attention service.
Test: manually tested the lifecycle is as expected
Bug: 111939367
Change-Id: I2dab9c69f3d0c6efb0db572f797f517dc6efcc72
This includes laying down some groundwork to make the remaining migrations
more straightforward
Bug: 110557011
Test: atest RoleManagerTest && atest SmsManagerTest
Change-Id: Ie96abd73751d10f521756c9dcdab2a5710ca2045
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
Add a new service to system_server. It purely forwards
data from internal APIs to iorapd over binder, it is not a binder
service itself.
Currently forwards ActivityMetricsLaunchObserver APIs from
ActivityTaskManagerInternal.
Bug: 72170747
Change-Id: Ic4fa283df1c16660099030c74a0039ef24866819
So that RollbackManagerService extends SystemService as per convention
and RollbackManagerServiceImpl need not be made public.
Bug: 112431924
Test: atest RollbackTest
Change-Id: I85d2fd27e4705637d5fb7342d9389ef12f869fc9
This change adds RollbackManagerService as a new system service for
managing apk level rollbacks.
To work properly this requires additional selinux policy changes. Fails
gracefully in case of selinux denials, until we have a chance to sort
out the proper selinux policy.
Bug: 112431924
Bug: 116512606
Test: atest RollbackTest, with selinux enforcement off.
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Change-Id: Id72aae9c4d8da9aaab3922ec9233ba335bc0198f
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), disable 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
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
This is a preparation to implement per-profile IME in
InputMethodManagerService (IMMS).
Multi-client IME is designed and implemented to be able to deal with
multiple profiles at the same time from its beginning [1]. This means
that when multi-client IME is enabled with system properties, it also
means that per-profile IME is enabled.
At the same time, the following classes need to change its behavior
whether per-profile IME is enabled or not.
* android.provider.Setings
* com.android.server.inputmethod.InputMethodManagerService
* com.android.server.textservices.TextServicesManagerService
* com.android.server.devicepolicy.DevicePolicyManagerService
* com.android.server.devicepolicy.OverlayPackagesProvider
The problem is that android.provider.Setings lives in the
frameworks.jar. Hence if we want to expose something like
PER_PROFILE_IME_ENABLED to android.provider.Setings, then such a flag
needs to live in frameworks.jar.
Note that this is expected to be a temporary change. Once per-profile
IME becomes always enabled in IMMS, we can safely roll back this
change.
Note also that static initializer of InputMethodSystemProperty is
expected to be evaluated only once as long as
InputMethodSystemProperty is loaded before Zygote.
[1]: I41dfe854557b178d8af740bc2869c936fc88608b
bae5bea23c
Bug: 120709962
Test: prebuilts/checkstyle/checkstyle.py -f \
frameworks/base/core/java/android/view/inputmethod/InputMethodSystemProperty.java
Test: Manually verified as follows:
1. make -j MultiClientInputMethod
2. adb install -r $OUT/system/priv-app/MultiClientInputMethod/MultiClientInputMethod.apk
3. adb root
4. adb shell setprop persist.debug.multi_client_ime \
com.example.android.multiclientinputmethod/.MultiClientInputMethod
5. adb reboot
6. Make sure that multi-client IME is enabled
Change-Id: Iad8aba7edb1e60ccc1ce5192a11e01b6aa8d00a0