1. Background started foreground service shall not have
while-in-use permissions including location, camera and
microphone. Many exemptions have been applied including:
--FGS started by widget.
--FGS started by notification.
--FGS started by IME or other visible app.
--FGS started by ROOT_UID, SYSTEM_UID, NFC_UID.
2. Add a phenotype key KEY_DEFAULT_BACKGROUND_FGS_STARTS_RESTRICTION_ENABLED
to turn on/off this feature (default is on).
3. In dogfood, if a background started FGS with while-in-use permission
(any of location/camera/microphone) run into this restriction, the FGS
will not been granted these permission. we show a toast message to
alert user and ask them to write a bugreport using instruction at
go/r-bg-fgs-restriction. So we can have a statistic how many apps will
be impacted by this feature.
These is a flag Settings.Global.FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED
to turn on/off the toast message (default is on, in dogfood)
Bug: 136219221
Test: atest android.app.cts.ActivityManagerProcessStateTest
atest android.app.cts.ActivityManagerApi29Test.java
atest android.app.cts.ActivityManagerFgsBgStartTest
Change-Id: Ibc8aaa6839a69136f9311bfacdbab9705b31b6a7
The new methods are specifically for non-handset devices
and are guarded by SET_INITIAL_LOCK permission.
Bug: 143612363
Test: TreeHugger
Change-Id: Ifbe6a1b11f4849ec0ea9515ac7b018bb446799ea
Signed-off-by: Julius D'souza <jdsouza@google.com>
Freeze apps when cached and unfreeze them once removed from the cache or
killed. Frozen apps will not use any CPU cycles, reducing power
consumption for misbehaving processes which might attempt to run
while cached.
Change-Id: Ib055352062825db62927015c33ee0a285aa4630c
Depends-On: pa/1495867, ag/9976279, ag/9981529, ag/9987868¬
Bug: 143308662
Test: manual, atest CachedAppOptimizerTest
Disable the ability to see historical app ops using dumpsys, and by
calling "getHistoricalOps", unless the calling package has an
instrumentation, or is the statsd package.
Fixes: 148227477
Test: attempt to call into getHistoricalOps while not an instrumented
application or statsd. The method should return an empty bundle. Run
"adb shell dumpsys appops --history" should return "no such arg", and
"adb shell dumpsys appops -h" should not show "--history" in the args.
Change-Id: Ie5ad9a90ffc0473aba958199450bcff9315f71a6
Some APPs(like OMA DM) might enable or disable 5G settings, so redesign
the setPreferredNetworkType behavior.
1. Create allowed_network_type in telephonyprovider
2. Create get/set allowed network type API
3. When APPs call setPreferredNetworkType() that will AND with allowed
network type.
Bug: 136730709
Test: By Manual
1. setAllowedNetwork to disable 5G
2. setPreferredNetworkTypeBitmask to set NR_LTE_GSM_WCDMA
3. framework set LTE_GSM_WCDMA to modem
Merged-In: Ia257e6ddaa33c32bc09340a59c9daf71ce1fa8cf
Change-Id: Ia257e6ddaa33c32bc09340a59c9daf71ce1fa8cf
This reverts commit 21de9eebb5.
Bug: 135951924
Test: Compile
Reason for revert: Uploaded CL to fix test failure
Change-Id: I29e2937406aaea92a5e24c06819ea22bf9c8b58d
Since all pullers now use StatsEvent instead of StatsLogEventWrapper,
this class can be deleted.
Test: m -j
Test: m -j statsd_test
Bug: 146578681
Change-Id: I63013768ee13af0235f8cd857ca3fc16d2fd877f
Add locus update event to the Usage Stats.
Test: Build and run on a test device with a test app.
Bug: 147594233, 147100454
Change-Id: I1e058ac87244d47719606d8dcfaea2df4bff43d2
Signed-off-by: Yuliya Kamatkova <yuliyak@google.com>
Bug: 140788621
This is a non-functional clean-up.
1. Rename the classes and methods used by the binder cache so that
everything public is based off of the binder name "hasSystemFeature".
2. Modified the hashCode() method to conform to the comments in cl/9965760
Test: Built a debug image and ran one iteration of MPTS. Verified that no
errors were seen.
Change-Id: I3ffdda43a7dbe30a12449ff346e1e22b379ee308
Making battery stats final broke telephony unit tests (old mockito does
not allow mocking final objects).
Bug: 148282682
Test: Compiles
Change-Id: Id65ba702aa551c7c23bbd6efa527ef2b930478f5
Previously we were using a separate SLEEP message to communicate
with the client. The sleeping implementation on the client though
simply transitioned it between STARTED and STOPPED states.
This CL relies on visibility updates to communicate the sleeping
state. The "sleeping" status field is still used in the server-side
to record when device started going to sleep, and prevents any
activity that was launched before to influence the power state of
the device.
Bug: 137329632
Test: AM/WM CTS and unit tests
Change-Id: Idd7f5bf6730d3372168d862ef713a44f700430f1
This CL extends NetworkCapabilities#mEstablishingVpnAppUid
to the network owner app UID and introduces a new public API
to get this owner app's UID.
Bug: 142072839
Test: atest FrameworksNetTests
Change-Id: Id83cdea62b89b586aff74e51e3fee60e53d37d4c