Commit Graph

4920 Commits

Author SHA1 Message Date
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
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
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
Eugene Susla
4b7c919e72 Communicate relevantEvents=0 for packages excluded from whitelist
Together with checking isObservableEventType this will result in a11y events
not being generated for packages that are excluded form a11y-service(s)
package whitelist

Test: cts-tradefed run singleCommand cts -d --module CtsAccessibilityServiceTestCases
Change-Id: Id65607aaccc7af7d870d009d609917ff3c6d0712
2017-12-20 10:41:12 -08:00
Narayan Kamath
f0202a953f WorkSource: Add support for chaining attribution.
WorkSource objects now hold references to zero or more WorkChain
objects, each of which represent a "chain" of attribution.

This change also changes most WorkSource APIs to be able to
deal with WorkChains. Several APIs do not necessarily make sense with
WorkChains and have been left unmodified :

- boolean diff(WorkSource): Does not account for WorkChains for now.
  This is a public API so we shouln't change it unless we decide to
  make WorkChains public.
- setReturningDiffs(WorkSource): Used internally only, will be removed
  in a future change.
- addReturningNewbs(WorkSource): Used for testing only, fill be removed
  in a future change.

In addition, two new (hidden) APIs have been added to add and query
WorkChains. These APIs have only been added to facilitate testing. They
will most likely change when we add non-test users.

Co-Authored-By: Yang Lu <yanglu@google.com>

Test: WorkSourceTest
Bug: 62390666
Change-Id: Iff361eb98e079c7b2146c092dc27a3618a813c94
2017-12-20 15:13:09 +00:00
Tony Mak
e3d1f65ab6 Add access control to trySetWorkModeEnabled and make it public
Test: Quick Settings -> Toggle work mode
Test: Settings -> Work profile settings -> Toggle work mode
Test: Turn off work mode -> Settings -> Turn on work mode in the suggestion
Test: Turn on work mode through tapping on work app

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

BUG: 70212757

Change-Id: I335c3ab2306a3eb794cd35a3a7b0d184dc31f85e
2017-12-20 13:47:53 +00:00
Narayan Kamath
1824f66c1c Merge "WorkSource: Remove unused WorkSource.stripNames." 2017-12-20 12:39:40 +00:00
Sudheer Shanka
b2f83c16d6 Update BatteryStatsImpl to track per-procstate cpu times.
BatteryStatsImpl will track this data by reading from
/proc/uid/<uid>/time_in_state whenever process state changes
and will include this data as part of batterystats dump.

Bug: 66953194
Test: atest core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Test: atest hostsidetests/incident/src/com/android/server/cts/BatteryStatsValidationTest.java
Test: atest core/tests/coretests/src/com/android/internal/os/BstatsCpuTimesValidationTest.java

Change-Id: Ibb3e07f518aaf7eea2a00bb95b95dc5f7e09552e
2017-12-19 15:52:25 -08:00
TreeHugger Robot
6348ddcd04 Merge "Make TOP_SLEEPING procstate more like a cached process." 2017-12-19 18:47:19 +00:00
TreeHugger Robot
81bfe137d0 Merge "Remove IIncidentReportCompleted and gmscore WW module would listen to android.intent.action.DROPBOX_ENTRY_ADDED and look up incident tag then upload the report." 2017-12-19 02:30:28 +00:00
TreeHugger Robot
60a3c1e313 Merge "incidentd: Dumping java process meminfo data." 2017-12-19 01:07:49 +00:00
Dianne Hackborn
bad8d91056 Make TOP_SLEEPING procstate more like a cached process.
When an app is on the top of the activity stack but the screen
is not on, this doesn't really count as a top app in the normal
sense.  In particular, we'd really like to apply the normal
restrictions we have on background and cached apps: no network
access, no ability to use wake locks, etc.  (In other words, in
this state the app's activity is stopped, so from its perspective
it is no different than the user leaving it to go to another app.)

To do this, we change the order of the TOP_SLEEPING proc state
out from the range of foreground states down to between the
cached and background states.

Test: ActivityManagerProcessStateTest
Bug: 70808931
Change-Id: I994caba8c27553a452de75efa358be0e683d046f
2017-12-18 17:05:52 -08:00
Kweku Adams
983829fec5 incidentd: Dumping java process meminfo data.
Bug: 65750823
Test: flash device and check incident.proto output
Change-Id: I9b10daddf0580b3fab4ed7970fb838a605eef0e6
2017-12-18 15:19:13 -08:00
TreeHugger Robot
205523d0a2 Merge "Add MtpStorageManager for monitoring filesystem events" 2017-12-18 13:52:14 +00:00
TreeHugger Robot
7221ed9a67 Merge "bugfix: adjust StatsLogEventWrapper length to make sure we don't lose data" 2017-12-16 03:15:59 +00:00
Yi Jin
26ac0306ad Remove IIncidentReportCompleted and gmscore WW module would
listen to android.intent.action.DROPBOX_ENTRY_ADDED and look up
incident tag then upload the report.

Bug: 69860192
Test: N/A
Change-Id: I7f60ad631e8b3243e209aba9408f18bf0bfd4750
2017-12-15 15:35:34 -08:00