Commit Graph

4328 Commits

Author SHA1 Message Date
Adam Bookatz
0fcadeaeb9 Merge "Avoid background getTotalTimeLocked misreporting" into oc-dev
am: 6029bce3b4

Change-Id: Ib8292cc59afe1933bad8d48907ad47c46bb73e87
2017-06-08 05:59:56 +00:00
Adam Bookatz
6029bce3b4 Merge "Avoid background getTotalTimeLocked misreporting" into oc-dev 2017-06-08 02:43:20 +00:00
Bookatz
6d79993cb3 Avoid background getTotalTimeLocked misreporting
It has been discovered that for background values of
AggregatedWakelock, Sync, Job, and partial wakelocks,
the value of getTotalTimeLocked is wrong and often very
negative. getTotalDurationMsLocked, which should provide the exact same
value in all of these cases (since background data is never pooled),
does not have this problem. So while the source of the bug is sought
out, we should use getTotalDurationMsLocked instead of getTotalTimeLocked for
these data.

Bug: 62352334
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest
Change-Id: I78e84368615578483ab8e9e5f0ee1d067491be08
2017-06-07 13:29:41 -07:00
Jeff Sharkey
dab10f2bb3 Merge "Remove old FUSE bypass now that we have sdcardfs." into oc-dev
am: 6746aa8c4d

Change-Id: I32f223228c45a4949ebf53c1ab73d20fa9950ed6
2017-06-07 19:13:01 +00:00
Jeff Sharkey
2063e4f6ba Remove old FUSE bypass now that we have sdcardfs.
This forces everyone to go through sdcardfs, instead of letting them
around the back door.

Test: builds, boots
Bug: 38231314, 27992761
Change-Id: I97b24d25599c7f86f9b535689e2f4ecf68261dac
2017-06-06 16:03:26 -06:00
Jeff Sharkey
28f6dc9512 Merge "Give Doclava our manifest; more permission docs." into oc-dev am: 65d4cbba37
am: 67cb5f5210

Change-Id: Ic4c30cdb8bbfda5b3703eb3c7c36c1bf8ab3a216
2017-06-06 16:17:39 +00:00
Ahmed ElArabawy
dd3b200c19 Merge "Revert "Revert "power hal: Use power HAL API 1.1""" 2017-06-06 16:01:55 +00:00
Jeff Sharkey
ec68b46bc8 Merge "Annotate @SystemApi with required permissions." into oc-dev am: c1406978a4
am: 7a2e4a8486

Change-Id: Ib629e25dbf047c110feaf03e4ff744b5c6df9aeb
2017-06-06 15:48:24 +00:00
Jeff Sharkey
67cb5f5210 Merge "Give Doclava our manifest; more permission docs." into oc-dev
am: 65d4cbba37

Change-Id: I2ec50efb67debd15d354db69b84fb620eb74bc0e
2017-06-06 15:28:26 +00:00
Jeff Sharkey
bfc4fcde9f Give Doclava our manifest; more permission docs.
We've seen some @SystemApi methods protected with non-system
permissions, so give Doclava the platform AndroidManifest.xml so it
can parse the actual permission protection levels to look for APIs
that are letting in non-system apps.

Also document more @SystemApi permissions.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api
Bug: 62263906
Change-Id: Ie0f0a5fb0033817bcc95060f2183a52ae4ae7b06
2017-06-05 17:38:19 -06:00
Jeff Sharkey
7a2e4a8486 Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
2017-06-05 22:28:21 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
TreeHugger Robot
0ea89f0f40 Merge "Add support for vibrator 1.1 HAL and TICK effect." 2017-06-05 16:40:57 +00:00
Michael Wright
57d94d9fb1 Add support for vibrator 1.1 HAL and TICK effect.
New HAL support is a bit hacky but gets us unblocked.

Bug: 38417655
Bug: 38417570
Test: Manual (hacked up 1.1 HAL implementation that just logs)
Change-Id: I207cce97c81734bac1ca00a5de18e160d13e2bbe
2017-06-02 15:48:49 +01:00
Narayan Kamath
f013daa3ac ActivityManagerService: Add support for new stack dumping scheme.
Tombstoned now fully supports java traces and intercepts, and the
debuggerd dump API has been extended to support dumps of java traces.

This change switches ANR dumping over to using this API when the
right system property is set. The new flow is as follows :

- The system_server creates a new file using File.createTempFile for
  each ANR detected by the activity manager. All dumps associated
  with that ANR go into that file.

- All dumps are initiated using debuggerd client API (debuggerd_trigger_dump)
  which handles all the timeout measurement for us. It can also
  guarantee that no writes are made to the file after the method
  returns, so we have no need of inotify watches and other fiddly
  mechanisms to monitor progress. Also, this would give us the ability
  to add meta-information about timeouts etc. to the dump file itself,
  thougt that hasn't been implemented just yet.

Test: Manual
Bug: 32064548

Change-Id: I37e72c467e6dc29da4347c2a2829eeeeb1ad3490
2017-06-02 13:55:10 +01:00
Jesse Hall
6e1ac796d5 Merge changes I101e5578,I157b6233
* changes:
  Init EGL only for HW-accelerated Activities
  Refactor graphics environment initialization
2017-06-01 21:17:53 +00:00
Joe Onorato
619f506c47 Merge "Track Partial wakelock time in background" into oc-dev am: 1dfd194f7d
am: b5ba4b1fd2

Change-Id: I72c27aeae5061102d725ba52fb72a0489117649d
2017-05-31 20:05:37 +00:00
Joe Onorato
6c74b2421b Merge "Batterystats track background bad ble scan time" into oc-dev am: fe06de1fc2
am: 41e3f1479c

Change-Id: I3e9425e32d72b7415e776076cb977716073eb921
2017-05-31 20:01:34 +00:00
Joe Onorato
b5ba4b1fd2 Merge "Track Partial wakelock time in background" into oc-dev
am: 1dfd194f7d

Change-Id: I06af34e0cf444fd7f26add4e6b54bcb0d7f4d617
2017-05-31 19:49:49 +00:00
Joe Onorato
41e3f1479c Merge "Batterystats track background bad ble scan time" into oc-dev
am: fe06de1fc2

Change-Id: Ibca369ace041435ce1f9a9997658b86fd4b5f087
2017-05-31 19:46:11 +00:00
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
Ahmed ElArabawy
d8b441150e Revert "Revert "power hal: Use power HAL API 1.1""
This reverts commit 48b908bd77.
and brings back commit 0a4e11480b

This commit directs framework to use Power HAL 1.1
The commit has been tested not to cause application startup time
regression which was the reason of reverting the original commit

Bug: 62040325
Test: Performance Tests along with other tests

Change-Id: I84fdff3136c85e62223e2ae2f66b5bcad4e491b8
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2017-05-31 09:51:12 -07:00
Jeff Sharkey
b562e53950 Merge commit '06951ac74d9e74b29037b0a5d8e3b9ad85983b5b' into mergeit
am: 3c3d9d8158

Change-Id: Ia4c7f1792c9b6e8e72b4ffe742249b02b82d0817
2017-05-31 14:54:24 +00:00
Jeff Sharkey
3c3d9d8158 Merge commit '06951ac74d9e74b29037b0a5d8e3b9ad85983b5b' into mergeit
Change-Id: Ifa69c7bb53de94312e2b32607fa098c194a4c72c
2017-05-31 08:43:51 -06: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
Makoto Onuki
4757517823 Merge "SelectionActionModeHelper should use target view's thread" into oc-dev am: 58f6f428fc
am: a629afb05e

Change-Id: Icaa2e4c459a68dd6d667c81a5762554391cd233f
2017-05-26 01:48:27 +00:00
Makoto Onuki
a629afb05e Merge "SelectionActionModeHelper should use target view's thread" into oc-dev
am: 58f6f428fc

Change-Id: I108e9cc771457bb537d2857cde8f96607dbb0a8f
2017-05-26 01:37:50 +00:00
Jeff Sharkey
bfdc9feffc Merge "Offer listener to observe StrictMode violations." into oc-dev am: a6b7e0a679
am: 02315ed73d

Change-Id: If5391cac47775031d05bab87b0effa8e2742230a
2017-05-26 01:22:43 +00:00
Jeff Sharkey
02315ed73d Merge "Offer listener to observe StrictMode violations." into oc-dev
am: a6b7e0a679

Change-Id: I1610373c91aa4fc2a60732c51145b585b6372729
2017-05-26 01:09:53 +00: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
Will Harmon
d9dcfb12b9 Fix NPE in UserManager.getUserName(). Unlike all other calls to
getUserInfo(), getUserName() was the only one that did not check for
null. This has led to NPEs like in b/37589362.
Test: none. :( Not sure how to force the race where getUserInfo()
returns null. Verified manually that getUserName() still works.

Change-Id: I98ef06fe99ba760ae0194ec256fc9d1f39d3b7e5
2017-05-25 17:36:50 +00:00
Dmitri Plotnikov
9ff9b9afbb Merge "Triggering quiescent reboot during OTA" into oc-dev am: d9417c53e0
am: a376eed263

Change-Id: I9796f43fc6dd78f40883c154f0e77f5b438e6bd8
2017-05-25 17:00:23 +00:00
Dmitri Plotnikov
a376eed263 Merge "Triggering quiescent reboot during OTA" into oc-dev
am: d9417c53e0

Change-Id: I0b2b42d95d739701a367bd5d25bebbd64d033ad0
2017-05-25 16:51:17 +00: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
9a99745428 Merge "Check VintfObject compatibility on boot" into oc-dev am: 4e962321ad
am: ab0605ceb5

Change-Id: Id4c700d6d5daf0ae08369b4c7263b7112dc3b609
2017-05-24 21:58:44 +00:00
Michael Schwartz
ab0605ceb5 Merge "Check VintfObject compatibility on boot" into oc-dev
am: 4e962321ad

Change-Id: Ie3f55facc983e421432549440a81c1978c3e9482
2017-05-24 21:50:47 +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
Jesse Hall
c37984f122 Init EGL only for HW-accelerated Activities
Most processes might end up using  EGL, but most don't except for
Activities with HW-accelerated UI. And for other cases, the startup
latency of initializing EGL on-demand isn't as important. So this
change only tries to early-initialize EGL for HWUI Activities.

It also fixes a logic problem that may or not have been an actual bug:
previously, we only chose a graphics driver if we successfully set up
shader cache directories, even though these are mostly unrelated. Now
we always choose a graphics driver, except in isolated processes that
can't use graphics.

Bug: 38215658
Test: systrace framework start and Clock launch, check eglGetDisplay
      is called by RenderThread in non-HWUI-Activity cases, and is
      called on a separate thread before RenderThread needs it for
      HWUI-Activity cases.
Change-Id: I101e5578a9d7c508d232d0edeed7ceff9d8a74d6
2017-05-23 17:05:53 -07:00
Jesse Hall
317fa5a92a Refactor graphics environment initialization
Put all of the setupGraphicsSupport-related code into one function so
its easier to follow the full logic, and less intrusive to the code
around the call-site. This isn't supposed to change behavior at all,
but is preparation for the next change which will.

Bug: 38215658
Test: launch Clock, observe relevant events in systrace
Change-Id: I157b6233c0e9daf65e41697b504aa7e7d684401c
2017-05-23 16:37:11 -07:00
Sudheer Shanka
fab200fdad Log if parcel size is too large when launching an activity.
Bug: 37172206
Test: manual
Change-Id: I07ee7a8d1186d25716902eb00697eb9aa94c7629
2017-05-22 21:24:25 +00:00
Michael Wachenschwanz
291ba2f0a4 Merge "DO NOT MERGE Revert "WTF Logging for catching memory issue in Parcel"" into oc-dev am: 61e2b15866
am: d6066c83ca

Change-Id: I9877b678a244e0149ba6bb6aa4a8185113571374
2017-05-19 18:56:25 +00:00
Adam Bookatz
3da7c56dd8 Merge "Cumulative wakelock time per uid" into oc-dev am: 1effe000b8
am: 95cf947fba

Change-Id: I58660c0671a49388f8b9fdff28060e9312fa497d
2017-05-19 18:41:45 +00:00
Michael Wachenschwanz
d6066c83ca Merge "DO NOT MERGE Revert "WTF Logging for catching memory issue in Parcel"" into oc-dev
am: 61e2b15866

Change-Id: I6dc739ac35e8965b3a6ed84fe03d20c0441193c5
2017-05-19 18:40:47 +00:00