Commit Graph

4500 Commits

Author SHA1 Message Date
Sudheer Shanka
3cb64c2c51 Merge "DO NOT MERGE: Update BatteryStatsImpl to handle change in no. of freqs." into oc-mr1-dev 2017-08-11 01:05:43 +00:00
Sudheer Shanka
06668b5f73 Merge "Update ConnOnActivityStartTest to be hermetic." into oc-mr1-dev 2017-08-10 22:52:40 +00:00
Sudheer Shanka
a87245d305 DO NOT MERGE: Update BatteryStatsImpl to handle change in no. of freqs.
Bug: 62240247
Test: cts-tradefed run singleCommand cts-dev -m CtsIncidentHostTestCases -t \
      com.android.server.cts.BatteryStatsValidationTest

Change-Id: I1328fe7bf29229e9563cde6eea80addf2b91ea5d
2017-08-10 15:36:47 -07:00
TreeHugger Robot
edf3384307 Merge "SharedMemory API changes" into oc-mr1-dev 2017-08-10 19:41:53 +00:00
Evan Rosky
003bd7e3ec Merge "Added focus behavior changes to Build.VERSION documentation." into oc-mr1-dev 2017-08-10 19:21:29 +00:00
Christine Franks
966f37ae23 Merge "Allow SMS and calling for demo users" into oc-dr1-dev
am: 4387d3a523

Change-Id: I163963c15c009eaf70907203cf941e182409eafc
2017-08-09 20:15:33 +00:00
Christine Franks
97a5480a1d Allow SMS and calling for demo users
Bug: 62712426
Test: manual - restrictions are unset in demo mode
Change-Id: I151fbfb8222e768403a7e5ba1fcf868ba35a1f22
2017-08-09 10:24:38 -07:00
Sudheer Shanka
b8f2316fb4 Update ConnOnActivityStartTest to be hermetic.
Bug: 38432755
Test: runtest -x services/tests/servicestests/src/com/android/server/net/ConnOnActivityStartTest.java
Change-Id: Ie847ec0a202021a2b2cf16bb2d720650c9ee847d
2017-08-08 22:34:46 -07:00
TreeHugger Robot
590f519f24 Merge "thermalservice: Add ThermalService java interfaces" into oc-mr1-dev 2017-08-08 01:15:41 +00:00
Sudheer Shanka
e913d8235c Merge "Track per-cluster times of each uid in microsec." into oc-mr1-dev 2017-08-07 23:32:50 +00:00
Adam Bookatz
0a1ae1bc56 Merge "Package wakeup alarms are now on screen-off timebase" into oc-mr1-dev 2017-08-07 23:22:31 +00:00
Todd Poynor
875e5c7451 thermalservice: Add ThermalService java interfaces
Binder service ThermalService broadcasts thermal events to registered
listeners.

Test: manual: marlin with modified thermal-engine.conf and temporary
      java thermal event listener
Bug: 30982366
Change-Id: I11f7fd18feff3b9af0eecc3fd3a13d54c0b97ff0
(cherry picked from commit dd05582eab)
2017-08-07 23:08:36 +00:00
John Reck
e4f60cce85 SharedMemory API changes
Hides getFd & getFileDescriptor due to lifecycle concenrs.
Adds ASharedMemory_dupFromJava to allow sharing a shared
memory region between Java & Native as safe as possible.
Mis-use results in an FD leak instead of double-close.

Bug: 64394076
Test: SharedMemory CTS tests
Change-Id: I01a5eb978fc4e99559a79baac75754c32f13bdc4
2017-08-07 15:36:10 -07:00
TreeHugger Robot
8ce50255c5 Merge "Only replace new line characters if the wakelock name contains one The original operation creates new string everytime which is expensive" into oc-mr1-dev 2017-08-07 21:10:49 +00:00
TreeHugger Robot
ce3e863f31 Merge "Reduce duplicate strings due to the package cache." into oc-mr1-dev 2017-08-07 21:05:42 +00:00
Jeff Sharkey
67f9d5070a Fix broken javadocs.
Bug: 64337634
Test: make -j32 doc-comment-check-docs
Change-Id: I20fdd3dcddef09111d35946c41c596c7689effa6
2017-08-06 07:37:08 -06:00
Bookatz
98d4d5cf3f Package wakeup alarms are now on screen-off timebase
Previously, wakeup alarms (for an app) were using the battery-on
timebase. Now they will instead use the battery-on-screen-off timebase.
In this way, apps won't be penalized for wakeups that occurred when
the device was being actively used anyway.

Also bumps up report version to 25.
Also bumps up parcel version.

Change-Id: I1b692a9137ff28d535e7a06b539f713b54a85ea9
Fixes: 64149996
Test: manually verified count doesn't increase when screen-on
2017-08-04 15:23:51 -07:00
Makoto Onuki
4501c61d65 Reduce duplicate strings due to the package cache.
Change from the previous attempt:
- Fixed the helper class.  The original version had a few bugs.
- Bundle.readFromParcel() now handles a Parcel with a read-write helper
properly.

** Comparison **
The following charts are the actual measurement with and without the fix,
using "dumpsys system".
- The red bar is "total private dirty".
- The X axsis is time since boot.

Without fix:
- #1 First boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=1971317391
-- Private dirty stabilizes at ~16.8M.
-- Loading system packages took 1.8 seconds.

- #2 Second boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=982210726
-- Private dirty stabilizes at ~17.5M.
-- Loading system packages took 0.5 seconds.

With fix:
- #3 First boot:
-- https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=791764875
-- Private dirty stabilizes at around the same level as #1.
-- Loading system packages took 1.9 seconds.

- #4 Second boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=1820894299
-- Private dirty stabilizes at around the same level as #1.
-- Loading system packages took 0.7 seconds.

Package manager start up time with and without the fix:
- (Ignored ones that are too fast; probably the thermal throttling didn't kick in.)
- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=499396796
- Before: 3.5 seconds (average of 5 reboots)
- After: 3.6 seconds (average of 5 reboots)

Package scan speed comparison:
- With the fix, first boot.
08-03 08:49:56.851  1000   779   779 I PackageManager: Finished scanning system apps. Time: 2133 ms, packageCount: 143 , timePerPackage: 14 , cached: 0
08-03 08:49:56.971  1000   779   779 I PackageManager: Finished scanning non-system apps. Time: 121 ms, packageCount: 11 , timePerPackage: 11 , cached: 0

- With the fix, second boot.
08-03 08:53:29.387  1000   779   779 I PackageManager: Finished scanning system apps. Time: 484 ms, packageCount: 143 , timePerPackage: 3 , cached: 143
08-03 08:53:29.424  1000   779   779 I PackageManager: Finished scanning non-system apps. Time: 37 ms, packageCount: 11 , timePerPackage: 3 , cached: 11

** Conclusion **
- This CL wil slightly slow down the boot time (0.2 seconds on a thermal-throttled bullhead), but
the system server's ram consumption will go down to the no-cache level.

- Using the package cache is still faster than not using it.

Test: build, boot, reboot, adb-install, reboot
Test: bit FrameworksCoreTests:android.content.pm.PackageParserTest
Test: bit FrameworksServicesTests:com.android.server.pm.PackageParserTest
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsOsTestCases -t android.os.cts.BundleTest

Bug: 64112468
Change-Id: I30691a032cb1dd1c7f6c1966a096c2f0d07a09cb
2017-08-04 14:19:32 -07:00
Yi Jin
0248336d4c Only replace new line characters if the wakelock name contains one
The original operation creates new string everytime which is expensive

Bug: 64272195
Test: NA
Change-Id: Id93d588a7d5a6b6c192a057fcd4296bd1c508516
(cherry picked from commit 8529150860)
2017-08-04 20:52:53 +00:00
Yi Jin
1533ffdc3e There must not have newline character in wakelock name
Bug: 64272195
Test: N/A
Change-Id: I07a7d9b9dfbf69acba0123bf4ec6e309c2a5a359
(cherry picked from commit dd214c2d36)
2017-08-03 22:56:15 +00:00
TreeHugger Robot
dd5afab0d4 Merge "Address API review comments" into oc-mr1-dev 2017-08-03 02:10:16 +00:00
John Reck
f995f9a87a Address API review comments
Also make it less error-prone to use unmap() incorrectly.
Bug: 64264008
Test: CTS tests pass

Change-Id: I21559676e7a850b76db4b61a31e43833396c6087
2017-08-02 10:24:18 -07:00
Dianne Hackborn
18482aef9e Improve docs about exceptions through Binder.
Test: built

Change-Id: I5b6af61daa373c92f7d7b3b341a20fbd9e691da9
2017-08-01 17:46:23 -07:00
Dianne Hackborn
47e6cc34bb Merge "Fix issue #64224738: Document return value of IBinder.transact()" into oc-mr1-dev 2017-08-01 20:01:32 +00:00
Makoto Onuki
f6764fb7f7 Merge "Revert "Reduce duplicate strings due to the package cache."" into oc-mr1-dev 2017-08-01 16:11:27 +00:00
TreeHugger Robot
0b8f281637 Merge "Add documentation on oneway transaction ordering." into oc-mr1-dev 2017-08-01 02:21:21 +00:00
Makoto Onuki
63e624a61e Revert "Reduce duplicate strings due to the package cache."
The pool is just broken.... I need to fix it and re-evaluate.

This reverts commit e86a29c6e6.

Change-Id: I296df71e76ffff1d1d0fc8a50e3493e20c124a7b
2017-08-01 00:42:33 +00:00
Dianne Hackborn
4cd650c008 Fix issue #64224738: Document return value of IBinder.transact()
Also add appropriate @NonNull and @Nullable annotations.

Test: built

Change-Id: I22de48105ef685baf594cfc004dd3e27e2ba09e9
2017-07-31 17:39:17 -07:00
Dianne Hackborn
6f12f2233e Add documentation on oneway transaction ordering.
Test: built
Change-Id: I4d2e336327a4ce9c8f76d49037c894e981bdf571
2017-07-31 17:02:51 -07:00
TreeHugger Robot
bb77e6c689 Merge "Reduce duplicate strings due to the package cache." into oc-mr1-dev 2017-07-31 17:52:41 +00:00
Evan Rosky
534de29749 Added focus behavior changes to Build.VERSION documentation.
Change-Id: I2c8f23f65ed6baabafd1a3a954be5f9f4341e2bc
2017-07-31 17:15:11 +00:00
Jeff Sharkey
b7479988d2 Migrate plans to @SystemApi, evolve permissions.
We're not yet ready to commit to SubscriptionPlan as public API, so
relax to be @SystemApi instead.  Add a new MANAGE_SUBSCRIPTION_PLANS
permission that we require apps to hold, unless they've been
delegated access via a trusted CarrierService.

Since several apps have the ability to provide plans for a single
subId, we now remember the "owner" who set the current plan
information, and we refuse to leak plan information beyond the app
that originally set it.

Relax permissions check to not require READ_PHONE_STATE, since we're
only returning data that an app provided to us earlier.  Also fix
NPE when SubscriptionInfo is missing.

Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 63997177, 63928277, 64156138, 63903381
Change-Id: If503378ef406dcaec438c9b41e837e0a821a3ef4
2017-07-28 16:59:14 -06:00
Makoto Onuki
e86a29c6e6 Reduce duplicate strings due to the package cache.
The following charts are the actual measurement with and without the fix,
using "dumpsys system".
- The red bar is "total private dirty".
- The X axsis is time since boot.

Without fix:
- First boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=0
Private dirty stabilizes at ~16.8M.

- Second boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=1918404197
Private dirty stabilizes at ~17.8M.

With fix:
- First boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=791764875
Private dirty stabilizes at ~17.0M.

- Second boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=1820894299
Private dirty stabilizes at ~17.0M.

Test: build, boot, reboot, adb-install, reboot
bit FrameworksCoreTests:android.content.pm.PackageParserTest

Bug: 64112468
Change-Id: I5ae9c1b2d021fe62526d4e0dd1a52a962b48206e
2017-07-28 15:09:13 -07:00
Benjamin Miller
ae4b64ab41 Merge "Docs: Note that DISALLOW_CONFIG_VPN stops VPNs from starting" into oc-dev am: 91f16ace4f
am: 5934ae605a

Change-Id: Ia4c07afe64fd3a0a743790f1e1284bdc1db0f4c5
2017-07-28 21:15:41 +00:00
Benjamin Miller
5934ae605a Merge "Docs: Note that DISALLOW_CONFIG_VPN stops VPNs from starting" into oc-dev
am: 91f16ace4f

Change-Id: Id7d2c62577e0b534a7dd6605f722e7c5639e46b7
2017-07-28 17:30:18 +00:00
Benjamin Miller
05fef7ed69 Docs: Note that DISALLOW_CONFIG_VPN stops VPNs from starting
VPNs don't start except a DPC's configured always-on VPN. Clarified version behaviors.
Staged at: go/dac-stage/reference/android/os/UserManager.html#DISALLOW_CONFIG_VPN

Test: make ds-docs and output staged UserManager page
Bug: 63582789
Change-Id: I83c0c6cc580b9d1d224a94e073f559f23cf4d672
(cherry picked from commit 1f83e4d498)
2017-07-28 09:56:24 +00:00
Sudheer Shanka
71f34b390d Track per-cluster times of each uid in microsec.
Bug: 62805443
Test: Used some apps and verified that battery usage is attributed to
      these apps in Settings>Battery.

Change-Id: I0e604fdc0d1704d7d061b6a711a0017b82a39b8f
2017-07-25 20:59:58 +00:00
Makoto Onuki
4fdefef7a1 Merge "Don't keep parceled extras for history broadcasts." into oc-mr1-dev 2017-07-24 17:42:31 +00:00
Bookatz
63959bae98 Merge "Batterystats: fix inappropriate bg timebase reset" into oc-dr1-dev
am: 2337b3ba84

Change-Id: Ie29e6ddb7ab37977130adbf566fac18c4dc5c26b
2017-07-22 00:41:57 +00:00
Makoto Onuki
97f82f28da Don't keep parceled extras for history broadcasts.
On dumpsys we do show history broadcast intents with extras, but
if an intent's extras are still parceled, we can't show anything
(but the length) anyway, so let's just remove them, because sometimes
they contain heavy objects such as bitmaps.

Bug: 62144301
Test: manual tests: Boot, add account start apps, insert SIM
Change-Id: Ia64dd46d66fba3098e32c435509f4940ae978710
2017-07-21 16:51:16 -07:00
Bookatz
993a0be676 Batterystats: fix inappropriate bg timebase reset
Previously, the background timebases (of a Uid) were reset when the Uid
resets in the wrong place. This caused StopwatchTimer.reset() to have the timesbase's old value to keep
track of its mUpdateTime. The solution is to call TimeBase.init at the
start of Uid.reset(), instead of calling TimeBase.reset() at the end of
Uid.reset().

Bug: 62352334
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Change-Id: I23c886544e18f154fc226cc81c22c3ea70fb4c7e
2017-07-21 15:26:13 -07:00
Benjamin Miller
ca4f0f98a2 Merge "Docs-change: how UserManager.ENSURE_VERIFY_APPS affects profiles." into oc-dev am: baa85250d4
am: aeb503f7ca

Change-Id: Iff0d3dbea379e2e90a2cf7fc82675eac2c088e11
2017-07-20 14:09:07 +00:00
Benjamin Miller
aeb503f7ca Merge "Docs-change: how UserManager.ENSURE_VERIFY_APPS affects profiles." into oc-dev
am: baa85250d4

Change-Id: I553b5b775cbdb42020405dfcc1b18032d4777597
2017-07-20 14:05:31 +00:00
Jeff Davidson
de7e5a5595 Merge "Revert disabling of eSIM wipes/retains." into oc-dr1-dev am: acdcf37e4b
am: 10238e562a

Change-Id: If5106972654149f5cb53aedae45964397dcfb69d
2017-07-20 04:38:28 +00:00
Jeff Davidson
10238e562a Merge "Revert disabling of eSIM wipes/retains." into oc-dr1-dev
am: acdcf37e4b

Change-Id: I10cc2501e38837f816c564716a6d157bc8f57ed6
2017-07-20 04:32:21 +00:00
TreeHugger Robot
acdcf37e4b Merge "Revert disabling of eSIM wipes/retains." into oc-dr1-dev 2017-07-20 04:24:50 +00:00
Jeff Sharkey
6d626c24e3 Merge "Let's get a constant for O_MR1." 2017-07-20 03:20:22 +00:00
Jeff Sharkey
7beabc264b Let's get a constant for O_MR1.
Test: none
Exempt-From-Owner-Approval: HULK SMASH!
Change-Id: I440ebae4d0891d9044bbbfb5beaaaa98639aea98
2017-07-20 03:19:33 +00:00
Ahmed ElArabawy
609f89bd63 Merge "Fix format of subsystem power stats" into oc-dr1-dev am: 5512504bba
am: fe4ec9e946

Change-Id: I7dba5de4a5de74fd654ae5d1fe03abc625510f16
2017-07-20 02:49:54 +00:00
Ahmed ElArabawy
fe4ec9e946 Merge "Fix format of subsystem power stats" into oc-dr1-dev
am: 5512504bba

Change-Id: I3f6b818d34a2a54f73a7192d10d462b68d6e6ed0
2017-07-20 02:43:54 +00:00