Commit Graph

4145 Commits

Author SHA1 Message Date
Michael Schwartz
4e962321ad Merge "Check VintfObject compatibility on boot" into oc-dev 2017-05-24 21:34:11 +00: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
Yifan Hong
9f95b592f8 Add android.os.VintfRuntimeInfo
This is the Java API for ::android::vintf::RuntimeInfo.
This will be used by CTS for device info report purposes.

Bug: 28656227
Test: cts-tradefed run cts -m CtsEdiHostTestCases --skip-preconditions
Change-Id: Id87c95a17e77d7ec1794a6f850de97edf9ae892d
2017-05-01 13:00:04 -07:00
Jeff Sharkey
3ba7117164 Merge "Updates based on API council guidance." into oc-dev 2017-05-01 18:36:25 +00:00
Salvador Martinez
4d09adcef1 Merge "Added dialog to notify user of thermal shutdown" into oc-dev 2017-05-01 16:45:30 +00:00
Jeff Sharkey
000ce80505 Updates based on API council guidance.
Test: builds, boots
Change-Id: I223faf55c1e1b4d81d11b4c8b2d93ccd131c969b
Fixes: 37775662
Fixes: 37748635
Fixes: 37673408
Fixes: 37672564
Fixes: 37672218
Fixes: 37638323
Fixes: 37637423
2017-04-29 13:14:17 -06:00
Bookatz
956f36bfe2 Add BLE results counter to batterystats
Batterystats provides an API to count the number of BLE scan results.

Bug: 37720787
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Change-Id: Idcb7494b39e88dcbfbb3da1ebe90b8a2f8f4d55c
2017-04-28 11:03:38 -07:00
Jeff Sharkey
4315c1e3d5 Merge "@hide non-Handler variant of SM.openProxyFileDescriptor" into oc-dev 2017-04-28 17:10:26 +00:00
TreeHugger Robot
77cc43e0d2 Merge "Respond to API council feedback." into oc-dev 2017-04-28 17:10:16 +00:00
Daichi Hirono
2443a091b1 @hide non-Handler variant of SM.openProxyFileDescriptor
Bug: 37749462
Test: Build succeeded
Change-Id: I2e3d0cf9e219353eae4dae384c93d99b9ef60ea9
2017-04-28 14:58:27 +09:00
Jeff Sharkey
a4d34d971c Respond to API council feedback.
Move aggressive allocation to @SystemApi, which means we can hide
the "flags" API variants.

Remove UUID APIs, since we should use existing Serializable APIs.

Relax permission checks to allow apps to ask for their own stats.

Improve docs.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 37534687, 37534941, 37718184, 37738770
Change-Id: I6a763fb3ab3169c8d3329765bb31e1ee08d9ced7
2017-04-27 11:33:39 -06:00
Pavel Grafov
4f4f6f83c2 Introduce DISALLOW_BLUETOOTH_SHARING.
When this restriction is enforced Bluetooth sharing option should not be
present when the user tries to share something. Previously this was handled
by explicitly disabling bluetooth sharing activity during managed
provisioning, now this code is to be removed (see topic CLs) and the same
behavior should be achieved by setting this restriction for profile owners
by default.

In Bluetooth:
1) Don't check restrictions on boot, it is invoked anyway through the
  listener during boot.
2) Ignore when the restriction is "changed" from true to true - i think
  it was the initial intent in that condition.
3) Disable the component for a particular user and not always the
  system user. This is something that has to be fixed in O I think since
  currently in secondary user the bluetooth itself gets disabled but the
  sharing thing still shows up.

In DPMS:
1) Now ActiveAdmin for PO also contains a set of restrictions applied by
  default.
2) Now all ActiveAdmins for POs are loaded quite early. That shouldn't
  have huge impact though.

Bug: 36249732
Test: run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testBluetoothSharingRestriction
Test: run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Change-Id: I78c4ffbd503c4a10138e8c0862a9f206f24c5631
Merged-in: I78c4ffbd503c4a10138e8c0862a9f206f24c5631
(cherry picked from commit 7f4ad75218)
2017-04-27 18:06:07 +01:00