Commit Graph

4933 Commits

Author SHA1 Message Date
TreeHugger Robot
6b7bf94740 Merge "incidentd: dumping jobscheduler to proto" 2018-01-09 23:15:19 +00:00
TreeHugger Robot
d4fed0ae19 Merge "Add hidden APIs that return user start/unlock time." 2018-01-09 21:35:14 +00:00
Hans Boehm
57fe793d31 Merge "Only count uncleared ProxyMap refs when deciding to crash" am: 90027eb1c2 am: c9e7c10afb
am: f81791c141

Change-Id: Ide59ad63505d92503da64bb70691ff370a548746
2018-01-09 20:46:35 +00:00
Kweku Adams
85f2fbcb1f incidentd: dumping jobscheduler to proto
Bug: 65750819
Test: flash device and check incident.proto output
Also test: $ cts-tradefed run cts-dev --module CtsIncidentHostTestCases --test com.android.server.cts.JobSchedulerIncidentTest
Change-Id: I4abc01ca893edcbaf4d2254e4f807e06f5cb91f8
2018-01-09 12:05:39 -08:00
Makoto Onuki
73dded28af Add hidden APIs that return user start/unlock time.
Bug: 69456806
Test: Manual test with "watch dumpsys-user"
Change-Id: I68ed4ef53c707ed7c8cb8be4165052f942ea8ccd
2018-01-09 11:57:55 -08:00
TreeHugger Robot
df86ddb3f9 Merge "Move zygote's seccomp setup to post-fork" 2018-01-09 19:43:10 +00:00
Hans Boehm
f81791c141 Merge "Only count uncleared ProxyMap refs when deciding to crash" am: 90027eb1c2
am: c9e7c10afb

Change-Id: I70169c5eeb5dbdaa751ea7b9369feb3663d79952
2018-01-09 19:38:55 +00:00
TreeHugger Robot
7ede382ce3 Merge "WorkSource: Fix WorkSource#remove for chained worksources." 2018-01-09 08:46:22 +00:00
Jeff Sharkey
d658207876 Merge "Wire up reserved blocks presence for tests." 2018-01-09 05:40:53 +00:00
Hans Boehm
d2fb7df2c1 Only count uncleared ProxyMap refs when deciding to crash
Add a method to compute the size of a ProxyMap without cleared
references. Use it in the crash decision. Report both counts, as
well as the count after a forced GC before actually crashing.

Rename the histogram generating function after a small refactoring
to make that easier.

When we crash, we now generate a message like the following
(generated here with reduced thresholds):

01-03 01:40:52.273  4793  4947 E JavaBinder: java.lang.AssertionError:
Binder ProxyMap has too many entries: 277 (total), 275 (uncleared),
257 (after GC). BinderProxy leak?

after the histogram. Unfortunately, the intervening GC may take some
time, and other intervening messages may sneak into the log between
them.

Experiments so far suggest that none of this greatly affects the
decision when to die. But this eliminates uncertainty as to whether
there was really a problem.

Bug: 71353150

Test: Tested with reduced thresholds, and then booted AOSP.
Change-Id: I53f24bae23eedcdb78a1c32296c65692b7bb2c42
2018-01-08 14:30:42 -08:00
Steven Moreland
09d9ac5819 Merge "Generic Mutable class for HIDL code." am: 0f05ce94c3 am: a4ac12c3ac
am: 98fa8b7eb0

Change-Id: I0062c37e0fe119ee31b8c72396e2be706a6469a5
2018-01-08 20:44:51 +00:00
Victor Hsieh
a188dbc050 Move zygote's seccomp setup to post-fork
Before this change, seccomp filter setup is as early as in zygote's main
function.  To make it possible to split app and system server's filter,
this postpone the setup to after fork.  It also starts to call app
specific and system server specific setup function.

Test: (cts) -m CtsSecurityTestCases -t android.security.cts.SeccompTest
Bug: 63944145

Change-Id: I748735b478405098beac1e200d911c13ea60e380
2018-01-08 12:43:00 -08:00
Steven Moreland
98fa8b7eb0 Merge "Generic Mutable class for HIDL code." am: 0f05ce94c3
am: a4ac12c3ac

Change-Id: I1914e805b15064b40b963840eddf87a0bbd41169
2018-01-08 20:25:30 +00:00
Jeff Sharkey
55fe0d0686 Wire up reserved blocks presence for tests.
This is how we tell CTS if the device has reserved blocks set aside
for system critical services.

Test: builds, boots
Bug: 62024591
Change-Id: Ib970554235b49346f9e9df7d3d1646beb168cd92
2018-01-08 10:41:50 -07:00
Narayan Kamath
ee07f627c9 WorkSource: Fix WorkSource#remove for chained worksources.
- It doesn't make sense to clear the list of WorkChains if we're
  remove is called with a WorkSource that has no chains.
- The early return for mNum <= 0 is faulty because it incorrectly
  returns early for WorkSources that have workChains but no flat
  UIDs.

Test: WorkSourceTest
Bug: 62390666
Change-Id: I4c0e69bdd7c114b41329aa329d1c1d08a8cb9b59
2018-01-08 12:43:29 +00:00
Jeff Sharkey
9f2dc0527e Add DataUnit to clarify SI-vs-IEC units.
Mirrors the design of TimeUnit and ChronoUnit which many developers
are already familiar with, making it easy to pick up and use.

Yes, this is an enum.

Bug: 70915728
Test: bit FrameworksCoreTests:android.util.DataUnitTest
Change-Id: Id0cfdac5c81ed89c3c9ece23c964acba4a4f8471
2018-01-07 19:06:01 -07:00
Steven Moreland
4bfa2ebb89 Generic Mutable class for HIDL code.
In general, using Mutable inside of structures
or as API arguments is a code smell. However, it
is the most syntactically clean way of fetching
something out of a lambda or inner class.

Using this, one can do:
Mutable<Result> res = new Mutable<>();
hidlObject.foo((...) -> {
    res.value = ...;
});

There is an alternative:
Result a[] = new Result[1];
hidlObject.foo((...) -> {
    a[0] = ...;
});

However, this alternative syntax is relatively messy.

Bug: N/A
Test: boot, use w/ wifi
Change-Id: Ibff13c653cc17bd25ddbb0534ba21ef485bff7aa
2018-01-05 19:13:06 +00:00
Jeff Sharkey
8eb783b21e FBE devices now fully support adoptable storage.
We've finished all the underlying work to support adoptable storage
on FBE devices, so remove the code that was disabling it by default.

Introduce feature flag to make it easier to detect devices that
support adoptable storage.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 29923055, 25861755, 33252673, 37289651
Change-Id: I3630d690c9e66c7e41e316a4263ea2eb1e752ad3
2018-01-04 18:50:14 -07:00
Tony Mak
d390ae9c7e Adjust permission checking of ensureCanModifyQuietMode
Two changes:
1. Verify caller package matches with calling UID before checking
   is it default launcher.

2. If IntentSender is specified, only caller with MANAGED_USERS
   can call through it.

Test: run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.QuietModeHostsideTest

Bug: 70212757

Change-Id: Iac118d988eb05097a56f343552c0b8845cf96749
2018-01-04 13:11:50 +00:00
TreeHugger Robot
48989c2744 Merge "1/ Change all "name" to id in statsD. 2/ Handle Subscription for alert. 3/ Support no_report_metric" 2018-01-03 23:36:21 +00:00
Yangster-mac
94e197cceb 1/ Change all "name" to id in statsD.
2/ Handle Subscription for alert.
3/ Support no_report_metric

Bug: 69522276
Test: all statsd unit tests passed.
Change-Id: I851b235f2d149b8602b0cad632d5bf541962f40a
2018-01-03 15:34:00 -08:00
Jake Wharton
d5909bd26e Merge "Add overload to postDelayed which accepts a token." 2018-01-03 21:32:49 +00:00
Jake Wharton
820e3dd74a Add overload to postDelayed which accepts a token.
This adds overload parity with postAtTime.

Test: none
Bug: 71546743
Change-Id: I50936c7ffd5e8512dc865863fe8d4c9fb228a8a9
2018-01-03 16:31:02 -05:00
Sudheer Shanka
bfea298303 Merge "Dump per-process state cpu times to batterystats proto." 2018-01-03 19:06:51 +00:00
Ahmed ElArabawy
f88571ffa1 Proper calculation for overall WiFi MC statistics
In current implementations the WiFi MC statistcs are calculating by
aggregating the per uid statistics accross all UIDs. This does not
result in the correct values in case of time overlapping acquisitions of
MC wakelocks by same or different UIDs
This commit creates a separate Timer instance that tracks the actual
time spent with MC Enabled.

Bug: 69854369
Test: Manual Test

Change-Id: I78533f48300bc9faccc374d684698dae647bde5d
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2018-01-03 09:06:42 -08:00
Sudheer Shanka
6d658d7d41 Dump per-process state cpu times to batterystats proto.
Bug: 66953194
Test: Compared dump of 'batterystats --checkin' and 'batterystats --proto' in text.
Change-Id: Ic70fe18fbb88cefa1e4299fde85121d0e80248fa
2018-01-02 19:31:01 -08:00
hj.seo
bef82eda3a Merge "Modify getting of primary storage size" am: 1c876b73b3 am: f8adea8255
am: 35d0ac5e07

Change-Id: I9ba0f6ac701174a1d6cdfdbc5008d40715295546
2018-01-03 01:37:21 +00:00
hj.seo
35d0ac5e07 Merge "Modify getting of primary storage size" am: 1c876b73b3
am: f8adea8255

Change-Id: I291fef4af5af22160952be48415463619d300ff2
2018-01-03 01:29:57 +00:00
Treehugger Robot
1c876b73b3 Merge "Modify getting of primary storage size" 2018-01-03 01:10:49 +00:00
TreeHugger Robot
abf7b71fe8 Merge "WorkSource: Update serialization to worksource.proto." 2018-01-02 11:57:24 +00:00
Narayan Kamath
e9353d38bd Merge "WorkSource: Fix getAttributionUid." 2017-12-29 12:54:34 +00:00
Andreas Gampe
267f0f16cd Merge "Binder: Log a histogram of binder proxies to logcat on death" am: 4b7abe301c am: 3c57709e70
am: 906d0c9375

Change-Id: I30960a4d831f420911b287145646be569423fdd0
2017-12-27 20:34:19 +00:00
Andreas Gampe
906d0c9375 Merge "Binder: Log a histogram of binder proxies to logcat on death" am: 4b7abe301c
am: 3c57709e70

Change-Id: I322ced9619f9982182c5b739007988fda89c6f30
2017-12-27 20:24:50 +00:00
Andreas Gampe
3fc030f083 Binder: Log a histogram of binder proxies to logcat on death
To help investigate potential BinderProxy leaks, attempt to log a
histogram of BinderProxy descriptors to the logcat before asserting.

Bug: 71353150
Test: m
Change-Id: I47313814160678369b15e7dc5851d8096c286b9d
2017-12-27 09:30:45 -08:00
Narayan Kamath
80434a7bed WorkSource: Update serialization to worksource.proto.
Now includes WorkChains.

Bug: 62390666
Test: manual
Change-Id: Idf3f9f3df86fb51ebcc938d7feb891789e16b68a
2017-12-27 15:44:17 +00:00
Narayan Kamath
cbe06778dd WorkSource: Fix getAttributionUid.
We define it as the UID that initiated the work, and not the UID
performing the work.

Test: WorkSourceTest.
Bug: 62390666

Change-Id: I1583e3f24b492e3f11a1281215c066fedf489b5f
2017-12-27 14:40:52 +00:00
Narayan Kamath
bbab9c4e28 Merge "Support WorkChains for WakeLock start / stop / change events." 2017-12-27 08:43:37 +00:00
hj.seo
e82e89ef90 Modify getting of primary storage size
Settings application shows internal storage size using API getTotalBytes in StorageStatsManager.
This API calls getPrimaryStorageSize() in StorageManager.
getPrimaryStorageSize() returns /data parition size calculated API roundStorageSize() in FileUtils.
Using this API, total primary storage size returns 8GB if 16GB emmc size device has /data partition size below 8GB.
So we should modify getting of primary storage size close to real emmc size.
getPrimaryStorageSize() will be calculated sum of /data and /system partition size.

Test: Check primary storage size in Settings application

Change-Id: I3ad33534b1c55d09afbb0e9be1c408c02c442842
Signed-off-by: hj.seo <hj.seo@lge.com>
2017-12-26 09:24:53 +09:00
TreeHugger Robot
a444dd4fb8 Merge "Updating Batterystats version to 29." 2017-12-22 23:17:53 +00:00
Kweku Adams
a8943cbae9 Updating Batterystats version to 29.
Bug: 70808931
Bug: 63813658
Bug: 62549765
Test: build Android
Change-Id: Ifc3e41d5189e9c21aaad82b13cf7ce7fbf39ade8
2017-12-22 13:21:06 -08:00
Narayan Kamath
8182202ac8 Support WorkChains for WakeLock start / stop / change events.
Log WorkChains associated with a given WorkSource to statsd whenever
a wakelock is acquired / released or changes.

Test: WorkSourceTest, manual.
Bug: 62390666

Change-Id: I1720ba8b1778d38067398caac7cf92c4d375f816
2017-12-22 16:21:07 +00:00
yuemingw
5fe75dc26d Add DISALLOW_AIRPLANE_MODE.
Bug: 67675441
Test: cts test will be added for b/67675455

Design doc: https://docs.google.com/document/d/1rvEg5jE3lMhjH-OA0iTLBUY2opM96fg7BrP81MoPnmg/edit#

Change-Id: I902b281695a7e734639c9d6d4852a0e96fea8305
2017-12-21 21:49:03 +00:00
yuemingw
7cc2c4c2ee Add DISALLOW_CONFIG_LOCATION_MODE.
Bug: 67674888
Test: cts test will be added in b/67674901

Design doc: https://docs.google.com/document/d/1rvEg5jE3lMhjH-OA0iTLBUY2opM96fg7BrP81MoPnmg/edit#

Change-Id: I284d421eedfb238084fa61e7661638c22b28734f
2017-12-21 21:48:15 +00:00
Siddharth Ray
331962242a Merge "Obtain cellular related battery statistics" 2017-12-21 19:53:54 +00:00
TreeHugger Robot
af5bac3d23 Merge "Profile lock timeout." 2017-12-21 13:37:42 +00:00
Narayan Kamath
6192f7322d WorkSource: Fix NPE on set(int) / set(int, String).
mChains might be null.

Bug: 62390666
Test: WorkSourceTest
Test: run cts-dev -m CtsOsTestCases -t android.os.cts.WorkSourceTest
Change-Id: I1dbc2abc576c280ad41ad6214745b0d34c5727a0
2017-12-21 10:24:52 +00:00
Sudheer Shanka
fa4bda70c3 Merge "Update BatteryStatsImpl to track per-procstate cpu times." 2017-12-21 03:51:40 +00:00
TreeHugger Robot
da8d32efbb Merge changes from topic "work_mode_api1"
* changes:
  Add access control to trySetWorkModeEnabled and make it public
  Merge setQuietModeEnabled and trySetQuietModeDisabled into one API
2017-12-21 01:20:28 +00:00
Siddharth Ray
a1fd057c85 Obtain cellular related battery statistics
API to obtain cellular battery stats for power
drain diagnostics.

Test: Manual

BUG:67647477
Change-Id: Iffdb1471cd55847b6454313c94497ab2cd6533cc
2017-12-20 14:56:29 -08:00
TreeHugger Robot
2756ddb85d Merge "Communicate relevantEvents=0 for packages excluded from whitelist" 2017-12-20 20:40:57 +00:00