Add usage stats tracking of screen time. There are two new
events, one for when the device is an interactive state, the
other for when it is non-interactive. Also add a whole new
usage stats API for retrieving aggregated data that is associated
with general events, not particular packages. In this case
it allows you to find the time the device spent interactive
and non-interactive and the count of the transitions in to
each of those states.
Bug: 74404949
Test: atest CtsUsageStatsTestCases:UsageStatsTest\#testInteractiveEvents
Change-Id: Ibe6d55e2aecb0c8519b1358644378ec5c7a4250d
Record USB data link state in addition to plug & charging state, since
modern USB controller can keep USB data link connected with minimum
current. Device is not acutally charging at those times.
Test: manual
Fixes: 76209292
Change-Id: I0710d547399a631d594488a524682ccc32a25ce6
We can't browse public volumes mounted for a different user, so don't
return an Intent claiming that we can, since it'll just fail.
Test: manual
Bug: 74056525
Change-Id: Iba4e52c2672258b981d2912875e55949bb35e310
New lower-level security fixes are blocking access, so make these
upper-level APIs reflect those properties.
Test: manual
Bug: 68857050
Change-Id: I81160755180f4f419d8577ea1f18a6ece10c560c
It's not required. Also, amend the javadoc to reflect the current
state of affairs.
Bug: 76418791
Test: make update-api && make checkapi
Change-Id: I7d68a0ab33967679af8cfc4161c8283d4471b561
This also fixes a failing CTS test.
Bug: 74975371
Bug: 73490092
Test: flash device and check incident.proto output
Change-Id: I4d0f7d1b45b1b620d903f4b46cbdc04dfe314958
Changed the existing hidden api setPackagesSuspendedAsUser to a system
api setPackagesSuspended that can be called by apps with either
MANAGE_USERS or SUSPEND_APPS permission. Additionally, the suspending
app can now specify optional extra information meant to be used by the
suspended apps and the launcher to deal with this state.
The following other APIs are added:
- isPackageSuspended(): Apps can query whether they are in a suspended
state
- @SystemApi getPackageSuspendedAppExtras(String): Apps with permission
SUSPEND_APPS can get the appExtras passed to PM when suspending the
app.
- @SystemApi setPackageSuspendedAppExtras(String, PersistableBundle):
Apps with permission SUSPEND_APPS can update app extras for a
suspended package.
- getPackageSuspendedAppExtras(): Apps can call to get the appExtras
passed in to PM when they were suspended.
Test: Can be run via:
atest com.android.server.pm.PackageManagerSettingsTests
atest com.android.server.pm.PackageUserStateTest
atest com.android.server.pm.SuspendPackagesTest
Bug: 74336673
Change-Id: I3b9ed2c8478b34ee2e8986f5f5fddb2839d102e3
So we can auto-generate tracing code for AIDL interfaces.
Bug: 74416314
Test: inspect atrace output
Change-Id: I42eee24358763305d6b4e954087f3331ad20f9b7
SysUI can now control the screen off animation as long as
config_dozeAfterScreenOff is set to false.
The current implementation collapses the notification shade and moves
the clock whenever the use is on the lock screen, or will fade the
scrims and show the clock when the keyguard is occluded.
Display state change (on, doze, doze_suspended) is delayed to let the
animations occur at 60Hz.
Test: atest packages/SystemUI/tests/src/com/android/systemui/doze/DozeUiTest.java
Test: atest packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Test: atest tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
Test: atest tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
Test: atest packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java
Fixes: 73178121
Change-Id: Id5d964452f342d4e97bedf1084efa808604e602c
Atom definitions for MobileConnectionStateChanged and
MobileRadioTechnologyChanged
Also cleans up batterystats.
Bug: b/72320589
Test: verified logs appear in adb logcat -b stats
Change-Id: I9feb258cf6dd4a8c8bf1cffc9566b5d0a851a9fa
Message.setAsynchronous is already public and this makes working
with posted messages that do not interact with UIs quite a bit nicer.
Added as factory methods for better integration with support shims
as well as generally encouraging the use of the handler callback
instead of subclassing for working with custom messages.
Bug: 73124158
Change-Id: I1210e7dc524fdf771e7af19297d5a822fdbd502c
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
1. Remove unnecessary hex_hashs.
2. Make intent extras LOCAL
3. Make mnc EXPLICIT
4. Make diskstats error AUTO since it is only IOException.
It is safe to modify proto numbers since they are not used yet.
Bug: 74837756
Test: flash the changes and call incident -d, also updated go/irpf
Change-Id: Idee0e927515e737c9a42a1dc29cb3c05e6d91ca9
Subscribers can now provide additional Strings that will be passed back to
it when an anomaly is detected. This way, the Subscriber can be informed
about anomaly-specific information has meaning to it.
Statsd itself does not use these strings and doesn't care what they are
- it simply passes them back to the subscriber.
Change-Id: If269872397c4ed2c67e41d54d850cdc664d4f73e
Fixes: 74012329
Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.alert.BroadcastSubscriberTests
Sent when the current battery level changes.
It has EXTRA_EVENTS that carries a list of Bundle instances representing
individual battery level changes with associated extras from
ACTION_BATTERY_CHANGED
Each event has EXTRA_EVENT_TIMESTAMP representing time when it occured.
Test: manual
Bug: 74020080
Change-Id: I993005950299c5298c9111ca51cc7717e1f029de
When Sidekick is controlling the display, any draw wake lock can cause a
sequence of endDisplayControl/setDisplayPowerState/beginDisplayControl
twice, because of DOZE_SUSPEND -> DOZE -> DOZE_SUSPEND transitions.
We can avoid that by telling power manager that display is controlled by
Sidekick, and draw wake locks shouldn't change the display power state.
Bug: 70574675
Test: build, flash Sardine, run Stopwatch, observe logcat
Change-Id: Ie4dac76606e45f0d3b62bc5890841f4f24d454d7
restriction is on.
Check calling uid in isSettingRestrictedForUser(which is called by settingsprovider),
and only allow system_uid when certain user restriction is on, so that user won't be
able to change these settings with adb:
Settings.Secure.LOCATION_MODE,
Settings.Secure.PROVIDERS_ALLOWED,
Settings.System.SCREEN_BRIGHTNESS,
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_OFF_TIMEOUT,
Settings.Global.AUTO_TIME,
Settings.Global.AUTO_TIME_ZONE.
This check also prevents 3rd party apps from modifying system settings value
when corresponding user restriction is on.
In addition, any attempt to change AUTO_TIME will also go through the check
for dpm.getAutoTimeRequired().
Test: manually by running the adb command with restriction set and not set
Bug: 72549013
Bug: 72548203
Bug: 72548533
Bug: 72686466
Bug: 72687105
Bug: 72940551
Bug: 72940562
Change-Id: I1d1fd20d9fa0f76f27905d62873f6a6e9af0224e
Now requires permission if targeting P.
Note that this is a separate permission from the existing one
that is required for instant apps to use foreground services. The
reason for this is that their semantics are different (the instant
apps permission is associated with an app op for control over what
the app is allowed, while the regular app permission is just a
normal permission that is always granted and only there for
auditing of apps), and there are probably going to be cases where
a developer will want to use a foreground service in the full
version of their app but not as an instant app.
Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I883c9515c307ed8e39f0bf888c4045944c8183ac
Bug: 36067387
Test: for C in {1..10}; do adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest$C \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner; done
atest CtsDevicePolicyManagerTestCases:LauncherAppsSingleUserTest \
CtsDevicePolicyManagerTestCases:LauncherAppsProfileTest \
CtsDevicePolicyManagerTestCases:LauncherAppsMultiUserTest
atest CtsShortcutManagerTestCases
Change-Id: Ia4ddea58f66861ef760865b6d8831563584f85c9
secdiscard never works on recent devices; stop calling it to
reduce the false SELinux denials messages. Just logically
zeroize the data before unlinking it.
Bug: 62140539
Test: flash device; change PIN; observe no SELinux error messages.
Change-Id: I5f47fc81735a7d9995c2da9e52a25ae903db3ced
This should help make sure the two stay in sync, and that the values
don't get rearranged.
Bug: 67013665
Test: N/A
Change-Id: I43f617b69d8c8107755c13dbfa8f071ef2c7c554
Instead of computing the average on the device, upload the
total sum of the latencies. Server can divide by the event count
if it wants to get the average.
Also change the latency buckets to 1 hr, 2 hrs, 4 hrs, 8 hrs and
greater than 8 hrs.
Bug: 70297451
Test: launch an app
dumpsys batterystats --checkin | grep jbd,
Observe the dumped values for the app
Change-Id: Iecda808594fc960fb16fa0407e5875bbc47db43a