Commit Graph

4155 Commits

Author SHA1 Message Date
Joe Onorato
1dfd194f7d Merge "Track Partial wakelock time in background" into oc-dev 2017-05-31 19:26:59 +00:00
Joe Onorato
fe06de1fc2 Merge "Batterystats track background bad ble scan time" into oc-dev 2017-05-31 19:26:59 +00:00
Jeff Sharkey
ddff807b76 Consistent "low storage" behavior.
When answering the question "how much space is free", use the same
logic for Settings UI and StorageManager.getAllocatableBytes().  That
is, the reported free space is usable bytes plus any cached data the
system is willing to delete automatically.

This does *not* include any reserved cache space, since we don't want
abusive apps to penalize other well-behaved apps that are storing
their data in cache locations.  Callers freeing cached data need to
now explicitly request defiance of the reserved cache space.  (Most
callers are already doing this by using FLAG_ALLOCATE_AGGRESSIVE.)

Rewrite the core logic of DeviceStorageMonitorService to understand
this new "reserved" cache space, and to be easier to understand.  It
also now handles cached data on adopted storage volumes, which had
been ignored until now.  Also fix bug where we had skipped "low"
broadcasts when the device skipped directly from/to "full" state.

Bug: 38008706
Test: cts-tradefed run commandAndExit cts-dev -m CtsJobSchedulerTestCases -t android.jobscheduler.cts.StorageConstraintTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Change-Id: Icbdcf3b52775f7ada1ceaeff2f96094c8d8052f9
2017-05-30 22:17:23 -06:00
Bookatz
b1f04f372c Batterystats track background bad ble scan time
Allows tracking ble scan time (total and background) for unoptimized
scans. Whether the scan is unoptimized is provided by the bluetooth
code when calling batterystats.

Bug: 38461344
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Test: run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testUnoptimizedBleScans
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest

Change-Id: I814482ff663424170eac4b413464d24c14a5cf91
2017-05-26 15:41:03 -07:00
Bookatz
5b5ec326ad Track Partial wakelock time in background
Changed partial wakelock time to be a DualTimer so that it can also
track the time spent while app was in background.

Bug: 62134255
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest
Change-Id: I85cca468ac126ee83a3600800bcfa75c9fc3012f
2017-05-26 11:25:06 -07:00
TreeHugger Robot
58f6f428fc Merge "SelectionActionModeHelper should use target view's thread" into oc-dev 2017-05-26 00:45:42 +00:00
Jeff Sharkey
a6b7e0a679 Merge "Offer listener to observe StrictMode violations." into oc-dev 2017-05-25 23:07:09 +00:00
Makoto Onuki
1488a3a19d SelectionActionModeHelper should use target view's thread
Use the looper from the TextView's thread for the helper

Bug 62043115
Test: Manual, type on edit field and select text

Change-Id: I501430a500016a81963a9f9fa636474b708b9b36
2017-05-25 15:33:10 -07:00
Dmitri Plotnikov
690c6bd9a3 Triggering quiescent reboot during OTA
Bug: 34201965
Test: follow instructions in https://docs.google.com/document/d/1RjvUGRi_Ys5-BRoJz6_SnixuipFiF-GAs6CNc7w-Qj0/edit and use fake-ota
Change-Id: I540f86cf11746faefc25bc74319512eba6d0d783
2017-05-25 03:03:41 +00:00
Michael Schwartz
4e962321ad Merge "Check VintfObject compatibility on boot" into oc-dev 2017-05-24 21:34:11 +00:00
Jeff Sharkey
c985ffd5e9 Offer listener to observe StrictMode violations.
Primarily used by tests to be more robust, since reading raw logcat
data recently became very flaky.

Bug: 37915178
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Change-Id: I3f12508bb6206c53005356b5d8d9ba57aac2436e
2017-05-24 14:51:48 -06:00
Michael Schwartz
1851118aa4 Check VintfObject compatibility on boot
Bug: 36814984
Test: Build, flash boot sailfish and shared system image.
Change-Id: Ibd6694079d9e2641a7b77d774a2df085e9a8545a
2017-05-24 12:22:33 -07:00
Michael Wachenschwanz
61e2b15866 Merge "DO NOT MERGE Revert "WTF Logging for catching memory issue in Parcel"" into oc-dev 2017-05-19 18:27:15 +00:00
Adam Bookatz
1effe000b8 Merge "Cumulative wakelock time per uid" into oc-dev 2017-05-19 18:24:44 +00:00
Michael Wachenschwanz
138bebf4c1 DO NOT MERGE Revert "WTF Logging for catching memory issue in Parcel"
This reverts commit 101e38cbec.

Bug: 37298089
Change-Id: Ia468d50fd1e4ca2ffa6145967bf3c847ed1929b8
2017-05-18 22:09:18 +00:00
Michael Wachenschwanz
a61f09f657 Merge "Purge Nonexistent User Jobs on Boot" into oc-dev 2017-05-17 18:58:12 +00:00
TreeHugger Robot
487231e79c Merge "Add more JSDoc about ErrnoException" into oc-dev 2017-05-17 02:17:01 +00:00
Michael Wachenschwanz
3f2b6552ec Purge Nonexistent User Jobs on Boot
In the case that a user has been removed but their jobs still exist on
disk, the JobSchedulerService will remove all jobs not associated with
current users on boot.
Exposed UserManagerService#getUserIds() via UserManagerInternal for
quick user id retrieval.

Fixes: 38261977
Test: manual

Change-Id: Id4b3c0a4142b4818fcd875eef18ea03f3c45ca40
Signed-off-by: Michael Wachenschwanz <mwachens@google.com>
2017-05-16 17:41:36 -07:00
TreeHugger Robot
146e8f415f Merge "Specify behavior around DocumentsProvider#openDocument()." into oc-dev 2017-05-16 22:34:41 +00:00
Bookatz
c8c44960c0 Cumulative wakelock time per uid
Currently, the time for each partial wakelock was tracked. If one
wants the total time that a uid held partial wakelocks (over all of its
wakelocks), they could sum over all the uid's partial wakelock
totalTimes, but this would underestimate the value because totalTimes
are pooled amongst all uids. Alternatively, they could sum over all the
uid's partial wakelock totalDurations, but this would overestimate the
value because totalDurations are not pooled within the uid (so there
will be double-counting if two wakelocks are held simultaneously). This
cl adds a new timer that specifically tracks the actual total time that
the uid spent holding wakelocks, and also provides the ability to see
how much time the uid was in the background when doing so.

Bug: 38198272
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: I20ea3546338c44ffdf06859bc840d9059fb18321
2017-05-16 14:01:28 -07:00
Garfield Tan
af03e5a322 Specify behavior around DocumentsProvider#openDocument().
Add supported modes and contracts on receiving unsupported modes.
Test: Builds.
Bug: 11279339

Change-Id: I8c403f6168baadb354813d4c1e630bb8662ddb34
2017-05-16 13:13:23 -07:00
TreeHugger Robot
28f0fd7a2d Merge "Invoke BLKSECDISCARD to securely delete sensitive data" into oc-dev 2017-05-16 16:26:47 +00:00
Rubin Xu
ee67b61bb0 Invoke BLKSECDISCARD to securely delete sensitive data
Bug: 34600579
Test: manual - change device lock under synthetic password, verify
      old data on disk is erased.

Change-Id: I247bd1f095dd27335e671981f9e2d77e149af84f
Merged-In: I247bd1f095dd27335e671981f9e2d77e149af84f
2017-05-16 13:30:05 +01:00
Ian Pedowitz
655ab3f59b Merge "Revert "Revert "O is API 26""" into oc-dev 2017-05-16 03:33:05 +00:00
Jesse Hall
0e72f130ab Require targetSdkVersion>=O for updated graphics driver packages
In O, graphics drivers are loaded into a new restricted linker
namespace. Drivers built for previous versions of the OS may not work
under those restrictions, so require an updated driver package to
declare compatibility by setting targetSdkVersion >= O.

Bug: 34228255
Test: manually construct packages with and without
      targetSdkVersion >= O, confirm driver is used/not-used as
      expected.
Change-Id: I4518360433a6de5c6e1e792a6eedddf8c6bf4394
2017-05-15 14:08:57 -07:00
TreeHugger Robot
47fe4a0bef Merge "OMS: Setup state for users on boot and when added" into oc-dev 2017-05-13 00:35:45 +00:00
Adam Lesinski
ada8deb436 OMS: Setup state for users on boot and when added
Some users never get switched to (managed profile/work profile) so the
overlay state for a user would never be setup (but they could still show
UI and apps).

This change ensures that user state is setup after an OTA to android O,
and whenever a user is added.

Bug: 37899201
Test: manual (add user via Device Admin sample: vendor/google/tools/DeviceAdminSample)
Change-Id: If214e26e39b18c2861794baf5c608a47d536e5ff
2017-05-12 15:42:52 -07:00
Daichi Hirono
0a3b2c60f8 Add more JSDoc about ErrnoException
Add more JSDoc about ErrnoException to ProxyFileDescriptorCallback

Bug: 37615067
Test: build
Change-Id: I5b59d44b87529edbd397416e56fd179df637bd79
2017-05-12 15:40:47 +09:00
Sudheer Shanka
9b735c5c1a Add time spent by uid per cpu frequency to batterystats.
Currently we have total user and system cpu time spent by the uid
in the batterystats. This change will add times spent by the uid
at each different cpu frequency to the batterystats dump which will
help in better understanding the battery usage.

Bug: 34133340
Test: manual
Change-Id: I567dc75875eb58543c0e71572d0b440e87dbb4b9
2017-05-11 20:56:46 -07:00
Dianne Hackborn
c3b938ca5e Merge "Fix issue #37360626: Apps can schedule alarms (and other things) with temp whitelist" into oc-dev 2017-05-11 18:28:46 +00:00
TreeHugger Robot
a9154ab391 Merge "Added isUserNameSet" into oc-dev 2017-05-11 03:19:52 +00:00
Michael Wachenschwanz
9254322192 Merge "WTF Logging for catching memory issue in Parcel" into oc-dev 2017-05-11 01:26:11 +00:00
Dianne Hackborn
983055231b Fix issue #37360626: Apps can schedule alarms (and other things) with temp whitelist
There is now an IBinder "token" that must be specified when setting
the whitelist duration for an Intent.  To have the whitelist supplied,
the caller to send a PendingIntent must pass in the same token.  The
PendingIntent and IntentSender classes now internally maintain this token
to pass in when their send() is called.

The big complexity for making this work is we now need to associate this
whitelist token correctly with the actual PendingIntent objects that
applications and other code is getting.  To do this, we propagate the
token in the Notification object, and have a new API on Parcel that allows
us to make it available to PendingIntent when it is unmarshalled.  And
this allows to deal with PendingIntents appearing in nested bundles, as
we can propagate that information from the original Parcel to the new
Parcel that Bundle keeps to delay unmarshalling.

Test: manual
Change-Id: Idda00490ccfe2be37e4ab21354b9ab7528a52750
2017-05-10 17:23:02 -07:00
Fyodor Kupolov
605b12a6d0 Added isUserNameSet
It can be used to check that the value returned by getUserName() was set
by the user and is not a default value returned by the system.

Test: UserManagerServiceUserInfoTest pass
Bug: 38138381
Change-Id: I0ca37970fda548508190bffd1fa7be95d4a15076
2017-05-10 15:58:09 -07:00
Michael Wachenschwanz
101e38cbec WTF Logging for catching memory issue in Parcel
Catch an exception sent from native code looking for a specific known
bug and report via wtf which code path is hitting the bug. Revert this
change once bug has been resolved.

Bug: 37298089
Test: manual

Change-Id: Ieb98a8a82a9a2cffe4d0cfbbc8333f453b3e36d5
Signed-off-by: Michael Wachenschwanz <mwachens@google.com>
2017-05-10 15:38:30 -07:00
TreeHugger Robot
7080fa5282 Merge "Add BLE results counter to batterystats" into oc-dev 2017-05-09 16:03:27 +00:00
TreeHugger Robot
6b1989c7e2 Merge changes from topic 'wakelockTotalDuration' into oc-dev
* changes:
  Wakelock durations are 0 instead of -1 if unused
  Added actual (unpooled) partial wakelock times.
2017-05-08 18:34:42 +00:00
TreeHugger Robot
00487cf936 Merge "Also log the value of the IAEs thrown in VibrationEffect" into oc-dev 2017-05-08 14:49:27 +00:00
TreeHugger Robot
718688f39b Merge "android.os.VintfObject: add API for EDI." into oc-dev 2017-05-05 21:47:47 +00:00
Yifan Hong
687113a082 android.os.VintfObject: add API for EDI.
Add APIs for EDI (extensive device information).

Test: CtsDeviceInfo
Bug: 28656227
Change-Id: I609d4f1f07e20717827ef024ff8cbe124d7e54a6
2017-05-04 14:11:22 -07:00
Ian Pedowitz
967869d0ed Revert "Revert "O is API 26""
This reverts commit 12025857cd.

Bug: 37480230
Bug: 37355569
Change-Id: I315b8c18a79d0dcd6be84c3d2af120b073144a9e
2017-05-04 00:10:04 +00:00
Ian Pedowitz
b42b9a22df Merge "Revert "O is API 26"" into oc-dev 2017-05-04 00:07:10 +00:00
Ian Pedowitz
12025857cd Revert "O is API 26"
This reverts commit 9bcef8e2da.

Reason for revert:  b/37355569

Bug: 37480230
Bug: 37355569
Change-Id: I39b4a7fd9bda77df0746c7bc32b87f0c2b722f2b
2017-05-03 22:00:56 +00:00
Yifan Hong
75ffd667a9 Add compatibility matrices to VintfObject.report()
Test: FrameworksCoreTests
Bug: 36814503
Change-Id: I27eaea136437afb2102581d410b657e810612a0a
2017-05-03 10:53:53 -07:00
Michael Wright
0ef6edd0a5 Also log the value of the IAEs thrown in VibrationEffect
Bug: 36827833
Test: manual
Change-Id: I64b85e746bd046a2718b690cc21c897950e34050
2017-05-03 15:05:46 +01:00
TreeHugger Robot
251894b134 Merge "Fix lock contention: Call into power manager service from handler" into oc-dev 2017-05-03 13:16:32 +00:00
Jorim Jaggi
86c39f9ede Fix lock contention: Call into power manager service from handler
Make sure to not hold the wm lock when calling into power manager
service, because PWM will acquire a lock that might be contended.

Test: Make sure user activity timeout is still respected on
Keyguard
Test: Have activity with screenBrightness=1.0, make sure screen
is fully bright when opened

Bug: 37888898
Bug: 36631902
Change-Id: I4b5433dbaf8aa151465ae32232d3b3b8597715df
2017-05-03 13:22:47 +02:00
Bookatz
941d98feba Wakelock durations are 0 instead of -1 if unused
Previously, wakelock max/current/total durations were initialized to -1,
instead of 0. So if, e.g., an app held a full wakelock but not a partial
wakelock, then the partial wakelock would return -1 for these data. This
cl changes that to be 0. The value will only be -1 if the data is not
tracked (as is currently the case for full and window wakelocks), in
which case if the wakelock was held, -1 will be given to signify the
lack of tracking.

Test: manually confirm 0 instead of -1 in batterystats dump.
Change-Id: I934022294ba5adafb2e4d9a5be1dc20aab045cb0
2017-05-02 19:25:18 -07:00
Michael Wright
9bcef8e2da O is API 26
Bug: 37480230
Test: build, boot
Change-Id: Idfa91e1e094606f92c4141beb8569c241c639ee1
2017-05-02 19:23:12 +01:00
Bookatz
506a8183fd Added actual (unpooled) partial wakelock times.
Previously, partial wakelock times reported the blame apportioned to the
app (i.e. the times were pooled). This CL adds another field to provide
the actual time the partial wakelock was held (unpooled, irrespective of
other app's wakelock usage). Full and window wakelocks also now have the
equivalent field, but it always returns -1 (like their max and current
durations), since none of those are currently tracked. Kernel wakelocks
are unchanged.

Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest
Bug: 18998184
Change-Id: Ic4cc8c3abba9afa60902d0c8e17e11abeef52a96
2017-05-02 11:16:55 -07:00