Commit Graph

4853 Commits

Author SHA1 Message Date
Kweku Adams
6ccebf2393 incidentd: Removing history from batterystats dump.
Bug: 65750808
Test: N/A
Change-Id: I4790b616791f68833196b50b76d3fd24faa8d46b
2017-12-11 12:30:35 -08:00
Jeff Sharkey
f9b2ef5933 Merge "Guide user towards adoption when card is "empty"." 2017-12-07 03:10:06 +00:00
Chenjie Yu
6842a8c66f bug fix for StatsLogEventWraper tag id
bug fix for ConfigManager fake config

Test: cts test
Change-Id: Ia07992dffb6520074c908151c96da1aa931f97f0
2017-12-06 22:39:56 +00:00
Jeff Sharkey
2035614ade Guide user towards adoption when card is "empty".
When a newly inserted SD card is empty, we'd like to guide the user
towards adopting it.  Similarly, if the card contains personal media
like photos, we'd like to guide the user towards using it as portable
storage.

Do this by quickly hunting around on the card for files under various
well-known directories.  Special logic to ignore bundled "helper"
apps included from the SD card factory.

Test: bit FrameworksCoreTests:android.os.EnvironmentTest
Bug: 69128181
Change-Id: I10e43d2e76379fac5137eb3810742c33f5f57d80
2017-12-06 15:22:09 -07:00
Calin Juravle
fd9f8ae973 Implement ArtManager#snapshotProfile API
Complete the implementation of ArtManager#snapshotProfile. The snapshot is
performed by calling the installer and then return to the caller via the
specified callback.

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases
Change-Id: I87131487846d91d79a56041445420376b61ca8e7
2017-12-06 18:29:06 +00:00
TreeHugger Robot
8cb0cf0aa9 Merge "Allow caller to specify target to start in setQuietModeEnabled" 2017-12-06 01:18:52 +00:00
TreeHugger Robot
1523386d85 Merge "PooledLambda" 2017-12-05 20:38:25 +00:00
Dianne Hackborn
d5b9266f01 Merge "Add major version code to platform." 2017-12-05 20:12:17 +00:00
Eugene Susla
2f5ee71ec8 PooledLambda
This introduces PooledLambda - a way of obtaining lambdas without the
allocations overhead.

See PooledLambda javadoc for a guide and PooledLambdaSample for code samples
of useful usages.

Test: ensure samples of PooledLambdaSample work as described.
Change-Id: I46f8ad27bc1de07e19f6e39f89d2cafe4238497a
2017-12-05 10:46:59 -08:00
Tony Mak
64fd8c0bdd Allow caller to specify target to start in setQuietModeEnabled
So, UMS can start the target once user is unlocked.

Test: No secure lock. Try turn off and on work mode by tapping work app.
Test: Have secure lock. Try turn off and on work mode by tapping work app.
Test: Turn off work mode. Reboot. Try to tap on any work app to turn on work mode.

BUG:69926710

Change-Id: Iaaccd5d763f7e36e5a43bad5261f1eb16060f9d6
2017-12-05 15:55:19 +00:00
Dianne Hackborn
3accca05dd Add major version code to platform.
It turns the version code into almost a 64-bit integer, with the
new major part being the upper 32 bits.

The only tricky part about this is the backup manager, since it
stored 32-bit version codes in its backup data sets.  This is dealt
with by, when the major version code is not 0, writing MIN_INT as
the version code and following that by the full long version code,
which we can detect when reading.  Note that this makes backup sets
containing apps with major version codes incompatible with older
versions of the platform.

Bug: 64459786
Test: Added in Change-Id: Iab8a682b62103babd6c16a56b8dc1e97d7078658
Change-Id: Ibfffe235bbfcf358b3741abd3f7197fdb063d3f3
2017-12-04 13:02:10 -08:00
David Chen
2e8f380737 Adds new API to retrieve statsd metadata.
This API can be used by clients to gather stats about statsd, eg.
memory usage, number of metrics/matchers, etc. This data can be used
to debug if devices are not providing expected metrics. The metadata
will be for all configurations, but will not contain the actual
collected metrics since those might have privacy implications.

Test: Tests that statsd and Android still build.
Bug: 69522276
Change-Id: I8e0fedc142f5deed7be6e6309f9444e67d8369ce
2017-12-04 10:23:28 -08:00
Olivier Gaillard
24a0c13687 Add documentation to recommend naming convention for wake lock tags
which help developers with debugging.

Test: only comments updated

Change-Id: If92730df384de15d3f7759e235104a3848321ffa
2017-12-02 00:26:21 +00:00
Hans Boehm
962fb77d37 Merge "Ensure that debug builds crash again if there is a BinderProxy leak." am: db122f90d9 am: 4fc1bb0e37
am: 9020d22c6d

Change-Id: I53f503ff0826030d2a112e41555b5e32b9524b5d
2017-12-01 16:07:00 +00:00
Hans Boehm
9020d22c6d Merge "Ensure that debug builds crash again if there is a BinderProxy leak." am: db122f90d9
am: 4fc1bb0e37

Change-Id: I949a3896f7613fe8bd3d92badba0fea5b3343e39
2017-12-01 15:56:23 +00:00
Hans Boehm
4fc1bb0e37 Merge "Ensure that debug builds crash again if there is a BinderProxy leak."
am: db122f90d9

Change-Id: Ibc470d844139fd2f74434a26d01903c67eb51f86
2017-12-01 15:46:09 +00:00
Hans Boehm
db122f90d9 Merge "Ensure that debug builds crash again if there is a BinderProxy leak." 2017-12-01 15:34:29 +00:00
TreeHugger Robot
d8dd05e7d6 Merge changes from topic "disable-avb-runtime-vintf"
* changes:
  Disable AVB check in runtime vintf
  Revert "Disable checking AVB in runtime vintf"
2017-12-01 03:14:51 +00:00
Hans Boehm
c79595fefa Ensure that debug builds crash again if there is a BinderProxy leak.
This fails when trying to run the AOSP mailer with CRASH_AT_SIZE = 500,
when the check interval is reduced sufficiently so that the test is
actually executed. System server has been observed to use more than
1000 BinderProxies. Thus 5000 seems like roughly the lowest safe limit.

Note that the test is executed somewhat rarely, so we may exceed
this number by quite a few before we actually crash.

Bug: 65760710
Test: Builds, AOSP boots & works for a few tasks. Fails as expected
with reduced limit.

Change-Id: I1c999b85e1ba1bd1d166a9ffba4f0b3992ffee45
2017-11-30 15:29:11 -08:00
Kevin Hufnagle
65cffffc20 cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java am: d6ebb55c62
am: fcd96e847f

Change-Id: I51b08b72f22f30a1e825a2192bc0f09f7d8f92f7
2017-11-30 19:35:53 +00:00
Kevin Hufnagle
fcd96e847f cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
am: d6ebb55c62

Change-Id: I88bf4c778a04b5f43a7fcd22d4aadb378860bb8a
2017-11-30 19:24:10 +00:00
David Chen
c136f45aee Adds guardrail for memory usage for statsd uid map.
Checks if current memory usage of uid map is above a configured limit
and if so, we start deleting snapshots. If there are no more
snapshots, we begin deleting two of the deltas. Also records stats
in the guardrail StatsdStats. Also fixes an edge case where a config
is added after the snapshots are added. We request a snapshot of all
installed uid's at that moment. Finally, adds the uid map memory size
when determining if we should send a broadcast to trigger collection.

Test: Added unit-tests and check they pass on marlin.
Change-Id: Id5d86378bd1efe12a06b409164c777c0c6f4e3ab
2017-11-29 14:55:15 -08:00
Kevin Hufnagle
d6ebb55c62 cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
Added note within getSerial() in android.os.Build class. Device
identifiers, such as hardware serial numbers, can be modified if a
device is rooted. Others can use key attestation to discover these
changes. Added a note to this effect within this method.

Test: make ds-docs -j8

Bug: 38312326
Change-Id: I76e3f6a15b9a8673ca3304218653e8cd26da38d7
Original-Change-Id: Ibd2dab621c14683e12a213957b567ee49b8d00fd
2017-11-29 14:41:05 -08:00
TreeHugger Robot
684cae74e3 Merge "Extreme battery saver: Force background check on all apps" 2017-11-29 00:43:29 +00:00
Makoto Onuki
e7ec72a5df Extreme battery saver: Force background check on all apps
- Power-saver whitelisted (including temp whitelist) apps and system UIDs
are exempted.

- Otherwise, background services and manifest receivers will be restricted
as if OP_RUN_IN_BACKGROUND is set to IGNORE.

Test: manual test
Bug: 68769804
Change-Id: I49e7d32357ffc177ace38a064f943643f4f71058
2017-11-28 14:45:11 -08:00
TreeHugger Robot
e75c145fba Merge "Add Multicast wakelock stats in battery-stats dump" 2017-11-28 18:43:55 +00:00
Jeff Sharkey
14e1b283e8 Merge "Skip FDE-specific operations, mkdir() throwing." 2017-11-28 16:57:19 +00:00
TreeHugger Robot
b0bebcfa09 Merge "WM: Add PhoneWindowManagerLayoutTest" 2017-11-28 16:14:35 +00:00
Adrian Roos
e1856fe710 WM: Add PhoneWindowManagerLayoutTest
Test: runtest -x services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
Change-Id: I85af4bdd023a274233362d42628de19483b0c4ea
2017-11-28 14:11:09 +01:00
Dianne Hackborn
bd0cdcdcc7 Merge "Add documentation for O and O_MR1 target SDK changes." into oc-mr1-dev am: b94e697dcf
am: 532c2f8a36

Change-Id: I27d9a43ec394fd9634d380b385b7317d1d92d89c
2017-11-28 01:02:23 +00:00
Dianne Hackborn
532c2f8a36 Merge "Add documentation for O and O_MR1 target SDK changes." into oc-mr1-dev
am: b94e697dcf

Change-Id: I40ef78ee243cbb2f5967115e40740a3f36b253ef
2017-11-28 00:50:13 +00:00
Ahmed ElArabawy
ddd096924e Add Multicast wakelock stats in battery-stats dump
This commit adds the statistics for multicast wakelocks (count/time)
in dump of battery-stats.
This enables debugging of power issues due to extensive wakeup of host
processor due to arrival of multicast packets, and help identify the
blamed application

Bug: 33649966
Test: Manual Test
Change-Id: I882f945dd36fa2881c59776b4954017bf3c76cd7
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2017-11-27 14:59:44 -08:00
Dianne Hackborn
a47d0453d9 Add documentation for O and O_MR1 target SDK changes.
Whoops, forgot to do this!

Bug: 69805350
Test: built and looked
Change-Id: Ic42cbcb7a62e7474c4864d66944452fed2e9005c
2017-11-27 14:08:16 -08:00
Jeff Sharkey
ae26646824 Skip FDE-specific operations, mkdir() throwing.
vold already complains about calls that are FDE specific, which
results in a lot of wtf() noise, so skip those operations outright.

Throw from failed mkdir() back to caller instead of wtf().

Test: builds, boots
Bug: 68736572, 68736551
Change-Id: I4dc06bdedacd2b66a1e7ae8e1434b194a875a756
2017-11-27 13:32:28 -07:00
Fyodor Kupolov
3b946f43a4 Use the root case to set remote stack trace for
Otherwise it may cause ISE if a cause has already been set like
in ParcelableException.

Test: manual install/uninstall an app on secondary user
Bug: 69704045
Change-Id: Ia8631ea76d5acf38e60fc609eef65f010ade21b5
2017-11-27 10:40:46 -08:00
Bowgo Tsai
b1de431405 Disable AVB check in runtime vintf
GSI disables AVB by overriding vbmeta partition.
When a device can run runtime vintf checking, it should already
pass AVB, so we don't need to check AVB in runtime vintf.

We cannot change the original VintfObject.verify() because AVB check is
still needed for android.os.RecoverySystem to verify a newly downloaded
OTA package.

Bug: 68016134
Test: Boot with GSI and there is no Android System dialog
Change-Id: Ie1efa6f1abd8fa8f495aededd145c0ab2c0c1fae
2017-11-23 16:38:32 +08:00
yro
947fbce521 Captures metrics on disk when devices reboot and shutdown. Specifically,
1. Create intent receiver in StatsCompanionService to listen to shutdown
events.
2. Create StatsWriter class to handle disk writes and deleting files.
3. Update StatsLogProcessor, ConfigManager, and StatsService to handle
files on disk using StatsWriter.
4. Add a wrapper for ConfigMetricsReport.

Still TODO is to be able to add a guardrail to prevent accumulating
excessive amount files on disk, which will be followed up by another
change.

Test: statsd, statsd_test
Change-Id: Ia0b3af315af545daa8b0078b3700c600aa7c285f
2017-11-22 18:39:23 -08:00
Yifan Hong
6f813c6a98 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs" am: e72b6f0d31 am: 8cf7761747
am: 523665a293

Change-Id: I901c938c2c56ab1c1649c218b37d4ab131cd3c7b
2017-11-22 23:28:56 +00:00
Yifan Hong
8cf7761747 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs"
am: e72b6f0d31

Change-Id: I7ea5895cdfd09786732b597be600329a334c1cb4
2017-11-22 23:06:33 +00:00
Yifan Hong
e72b6f0d31 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs" 2017-11-22 22:51:19 +00:00
Dianne Hackborn
1edf09c99b Merge "Fix issue #67019445: Detect BATTERY_LOW/OKAY" 2017-11-22 18:27:59 +00:00
TreeHugger Robot
f8d6392430 Merge "Output doze mode power in BatteryStats" 2017-11-22 02:55:50 +00:00
Dianne Hackborn
74ed6ecdc4 Fix issue #67019445: Detect BATTERY_LOW/OKAY
Add a new extra that indicates the battery is low.

Test: BatteryConstraintTest updated
Change-Id: I9ff92e15974ea092283a840cd01c860d6586c9b5
2017-11-21 16:33:44 -08:00
TreeHugger Robot
9253eeadbd Merge "The pm command is no more." 2017-11-21 20:31:47 +00:00
Fyodor Kupolov
a8f07c0b1e Merge "Use newline to separate stack trace lines" 2017-11-21 20:26:00 +00:00
TreeHugger Robot
fe731413da Merge "Global a11y action to lock screen" 2017-11-21 20:08:11 +00:00
Fyodor Kupolov
679d998796 Use newline to separate stack trace lines
It was unintentionally removed in patchset 3 of ag/3221176

Test: manual
Change-Id: Iede0bfe1b5d622fda794ddf4a0bcdbdaeeb4939d
2017-11-21 10:42:23 -08:00
Dianne Hackborn
1704e3cf0c The pm command is no more.
It is now just a shell of itself. :)

Also brings in a few fixes to never try to open files from the system
process.

Test: manual
Change-Id: Ia8187196af597046fd2e7092dbf19ce1dc1ea457
2017-11-21 10:17:14 -08:00
Yifan Hong
bb0bd00b00 android.os.HidlSupport: add getPidIfSharable() for HALs
... that returns PID of the process for debuggable builds.
This calls into the C++ equivalent of the function.

Test: lshal
Bug: 68992575

Change-Id: Ia177c709c6930510035cff33dc2389441a76351d
2017-11-20 11:51:07 -08:00
yro
29f69e8f04 Remove IStatsCallback aidl from master
Test: statsd, statsd_test

Change-Id: Idd0fb945b62f3a139a0db07f1014a3c4a4e2f5f8
2017-11-20 11:13:19 -08:00