Commit Graph

3828 Commits

Author SHA1 Message Date
Alex Naidis
bede012069 Merge "StorageManager: Improve exception handling" am: cf3a4a68bd am: 545cf37844 am: edca8aa3a8
am: 32dfe8c611

Change-Id: I5faf99bd2b4425f1615419de43f247f78d74108b
2017-01-09 17:14:34 +00:00
Alex Naidis
32dfe8c611 Merge "StorageManager: Improve exception handling" am: cf3a4a68bd am: 545cf37844
am: edca8aa3a8

Change-Id: Idbd8b16f0825bdcf48d2013448c767d0966434fe
2017-01-09 17:09:31 +00:00
Alex Naidis
19d9c2d03c StorageManager: Improve exception handling
When "getPrimaryStorageSize" provides a path
to "readLong", the option that the path
doesn't exist is expected, since it tries
all paths from "INTERNAL_STORAGE_SIZE_PATHS"
until there is success.

This patch makes us catch the "FileNotFoundException"
and "NumberFormatException" seperately.

For the above reason a "FileNotFoundException"
is now treated as an information only.
The "NumberFormatException" and other exceptions
are now treated as error since those are not
expected to happen.

Change-Id: I5316f9c3108e36c31b27dc5df8bf8ac4d4257629
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-01-09 16:27:52 +00:00
Nick Kralevich
4429993d78 Merge "Dumps total size of primary storage." am: 55dc66dde4 am: 12b387dd87
am: a63462c794

Change-Id: I2a62442a581d89054421dd6c44c610fb7ee9a0c4
2017-01-08 15:09:21 +00:00
Felipe Leme
c0d3f0ed52 Dumps total size of primary storage.
BUG: 32069168
Test: manual verification

(cherry picked from commit 281389ac54)

Change-Id: If5dee52a99c03a00dada22736c09d953dc0b66d1
2017-01-08 03:51:37 +01:00
Adam Lesinski
6224a32197 Merge changes from topic 'learned_capacity'
* changes:
  BatteryStats: Report learned battery capacity as event
  Parcel/unparcel charge_full state from BatteryProperties
2017-01-07 01:51:07 +00:00
Narayan Kamath
3aea733059 Merge "PackageManagerService: Implement packageParser cache in ParallelPackageParser." 2017-01-06 09:14:03 +00:00
Steven Moreland
4d3caf3938 Merge "HwBinder: get/register checked exceptions." am: 9ec4fec5ca am: 3290ba072b
am: 94924f38fb

Change-Id: I3b871a941856fdeb0e989aeaadc5fdbc7732b681
2017-01-06 01:16:02 +00:00
Narayan Kamath
5c50e86301 PackageManagerService: Implement packageParser cache in ParallelPackageParser.
We save about 2800ms of cold startup time over baseline on a marlin,
and ~1200 ms over the parallel parsing case.

                   warm     cold
		   ---------------
Baseline         : 1700ms   4300ms
Parallel         : 1400ms   2700ms
Cache            : 1000ms   1600ms
Cache & parallel : 900ms    1500ms

Note that further changes will improve the speed of cache processing.

This change also includes support for :
- a flag that been flipped in code (currently set to false).
- disabling the cache via a system property.
- wiping the cache on system upgrades.
- cache versioning.

Bug: 30792387

Test: FrameworksServicesTests
Test: manual timing

Change-Id: I281710c110af5307901dd62ce93b515287c91918
2017-01-05 19:15:31 +00:00
Steven Moreland
20ca2f782b HwBinder: get/register checked exceptions.
Bug: 33673120
Test: hidl_test_java
Change-Id: Id19b61b252e756a032ae11f7b59bd8eed82edbe9
2017-01-05 09:22:03 -08:00
Steven Moreland
c0631d0bb7 HwBinder: get/register checked exceptions.
Bug: 33673120
Test: hidl_test_java
Change-Id: Id19b61b252e756a032ae11f7b59bd8eed82edbe9
2017-01-05 09:20:44 -08:00
Nicolas Prévot
b4413f694f Merge "Make disallow add/remove managed profile restriction not global." 2017-01-05 14:54:45 +00:00
Nicolas Prevot
2ea46fe658 Make disallow add/remove managed profile restriction not global.
Otherwise: if the DO sets remove managed profile user restriction:
the profile owner of a managed profile cannot remove this managed
profile.

BUG:33854430
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I90b2028ea627a2073298bf9ef3c07b4fdf8d13a1
2017-01-05 11:58:21 +00:00
Amith Yamasani
c9facc0a1f Merge "Track background sensor usage" 2017-01-05 00:32:10 +00:00
Amith Yamasani
ab9ad195d1 Track background sensor usage
Keep an additional counter for background access
of sensors. Increment the count when sensor is
accessed while process is in the background state.

Bug: 33553631
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java
Change-Id: I87d7dbdaf4c34aa9dd9c7e13134d8f5f759f4e2b
2017-01-04 12:34:57 -08:00
Amith Yamasani
8a86825e7e Merge "Fix for race in writeToParcel and unparcel" 2017-01-04 18:23:38 +00:00
Steven Moreland
3b20d72697 Merge "Add checked exceptions to HwBinder transact." am: 6c5cc261f8 am: ca5d560090
am: d38478cb50

Change-Id: Ic0c6eb87c57aca798ff167a71929f1a0e3132a75
2017-01-04 05:11:06 +00:00
Steven Moreland
e62b1f32f3 Add checked exceptions to HwBinder transact.
Bug: 33673120
Test: hidl_test_java
Merged-In: I7b62eb6b066fc24c44ef7e46aaa2a3208c053d11

Change-Id: I7b62eb6b066fc24c44ef7e46aaa2a3208c053d11
2017-01-04 01:13:16 +00:00
Steven Moreland
27538df549 Add checked exceptions to HwBinder transact.
Bug: 33673120
Test: hidl_test_java

Change-Id: I7b62eb6b066fc24c44ef7e46aaa2a3208c053d11
2017-01-03 16:41:34 -08:00
Jeff Sharkey
dbc2ef417b Merge "Offer to measure disk stats using quotas." am: f8720b95be am: 4b80a4a372 am: 1e1cdbead1
am: 7664e61885

Change-Id: I91c0810aad2ec530650855bcd2f1d25c309717a1
2017-01-03 19:56:07 +00:00
Jeff Sharkey
7664e61885 Merge "Offer to measure disk stats using quotas." am: f8720b95be am: 4b80a4a372
am: 1e1cdbead1

Change-Id: Ic00acfb0efb6188a15357322528075d41467310b
2017-01-03 19:48:36 +00:00
Jeff Sharkey
5eb3eb58ac Offer to measure disk stats using quotas.
Now we're getting somewhere!  This CL starts measuring disk usage
using quotactl(), which is almost instant and has much lower impact
on flash memory lifetime.

We now grant the per-app cache GID to every launched app, and the
ContextImpl logic that creates cache directories matches the logic
down in installd.

Test: builds, boots, quota stats match manual stats
Bug: 27948817
Change-Id: Ie269a2958ce0e1c17cb74dbfecc791a5c12922cf
2017-01-03 10:22:39 -07:00
Martijn Coenen
872a5c0cdf Merge "Add (un)linkToDeath support to HwBinder." am: 7705363166 am: 010d0be575 am: 1f8c96ca7f
am: c052e6c67f

Change-Id: I5b515db7eaeac33a9072e6046f4c5bb948d5aa39
2016-12-29 09:27:24 +00:00
Martijn Coenen
c052e6c67f Merge "Add (un)linkToDeath support to HwBinder." am: 7705363166 am: 010d0be575
am: 1f8c96ca7f

Change-Id: Ic195a1f3ab2a9d318fe667ac3be0ce166119dc66
2016-12-29 09:19:55 +00:00
Martijn Coenen
727f7bf84f Add (un)linkToDeath support to HwBinder.
This is mostly copied over from binder's existing
death recipient support. The implementation keeps
a list of registered recipients, both for being
able to map a native recipient back to the corresponding
Java recipient, as well as being able to unregister
recipients correctly.

Test: mma, hidl_test_java
Bug: 31632518
Change-Id: Id313fd248be6925056c4ade8298fe5fb04e007cc
2016-12-29 04:22:30 +00:00
Selim Cinek
7e5cff0167 DO NOT MERGE Revert "Add Brightness setting for VR Mode."
am: 966045d070

Change-Id: Ib1be78a47f5947f4fcc6eabc2f6af76523690ed9
2016-12-27 19:22:04 +00:00
Selim Cinek
966045d070 DO NOT MERGE Revert "Add Brightness setting for VR Mode."
This reverts commit 84980c7a93.

Bug: 33895226
Bug: 30984614
Change-Id: I2652e77512bc870190e2172a629abac9341b2c4f
2016-12-27 18:28:40 +00:00
Ian Pedowitz
7e96654f1b Revert "Add Brightness setting for VR Mode."
This reverts commit c7e853f511.

Bug: 33895226
Bug: 30984614
Change-Id: Icca320e02651b7dd7b8db84ab414f41edee32760
2016-12-27 18:28:36 +00:00
Santos Cordon
84334e25cd Add Brightness setting for VR Mode.
am: 84980c7a93

Change-Id: I4a9c3db7bdf73e673cf8b2409404339df94086c2
2016-12-22 23:58:05 +00:00
Santos Cordon
84980c7a93 Add Brightness setting for VR Mode.
This change saves and loads a different brightness setting when the user
goes in and out of VR Mode.

Bug: 30984614
Merged-In: Ie5578bbd6ea346f0eb34fe4abbfd604a5d7c0c93
Change-Id: Ie5578bbd6ea346f0eb34fe4abbfd604a5d7c0c93
2016-12-22 23:26:49 +00:00
Santos Cordon
c7e853f511 Add Brightness setting for VR Mode.
This change saves and loads a different brightness setting when the user
goes in and out of VR Mode.

Bug: 30984614
Change-Id: Ie5578bbd6ea346f0eb34fe4abbfd604a5d7c0c93
2016-12-22 12:27:51 -08:00
Jeff Sharkey
f361f2fc89 Finish up API for missing content:// flags.
Feature is already built under the hood, but it needs it's own public
StrictMode API so it can be independently enabled.

Test: builds, boots
Bug: 32447617
Change-Id: I3c0c6d62dd36aaf25f30e0ef8e0e7b40cf32c6d2
2016-12-21 10:48:47 -07:00
Kweku Adams
c9430110da Fixing issue in current and max duration calculations.
am: c6bd4243a4

Change-Id: I109e0599a631de20d28723bb9ad714c0aedb2fac
2016-12-16 23:51:17 +00:00
Tamas Berghammer
f4b0962cac Enable logwrapper functionality on user builds am: 0ca16fa584 am: db05d4b4ed am: ed8757a761
am: f00963c71f

Change-Id: I10b9a367a1c2477683dbb404ebb8bfdd41d92263
2016-12-16 20:03:36 +00:00
Tamas Berghammer
a5a598c969 Zygote: Add invoke-with to zygote protocol am: b8f7c351b9 am: 45c2fffc52 am: d71bb300e6
am: b8d0e4d9fc

Change-Id: I7d962109d6fae5e0a359cb3fe04b1fc191e545de
2016-12-16 20:02:41 +00:00
Tamas Berghammer
f00963c71f Enable logwrapper functionality on user builds am: 0ca16fa584 am: db05d4b4ed
am: ed8757a761

Change-Id: I0f27f6aeb58690addb1c5f7978047ccb8d73ab84
2016-12-16 19:54:58 +00:00
Tamas Berghammer
b8d0e4d9fc Zygote: Add invoke-with to zygote protocol am: b8f7c351b9 am: 45c2fffc52
am: d71bb300e6

Change-Id: Ied54640c44ade52abd6a905526ba7789be14a332
2016-12-16 19:54:11 +00:00
Amith Yamasani
694753465b Fix for race in writeToParcel and unparcel
Don't access the parcelled data while it might be recycled
by another thread.

Also make a local reference of mMap, which could be modified
by another thread.

Bug: 33325384
Test: Hard to repro, so no test
Change-Id: I77f6545ac174236a3da69c0c0f3a01b2eda3f34b
2016-12-16 11:19:42 -08:00
Joe Onorato
10e237e5c8 Merge changes from topic 'incident_1'
* changes:
  First checkin of incident reporting.
  Add a native class to interact with DropBoxManager.
2016-12-16 18:19:50 +00:00
Tamas Berghammer
0ca16fa584 Enable logwrapper functionality on user builds
When an app is debuggable, check whether a script called "wrap.sh" exists
in the app's native library directory. If so, start the app using the
invoke-with functionality over the script. Weaken the invoke-with check
on the zygote side to allow the functionality for debuggable apps.

The goal of the functionality is to make malloc debug, strace and other
similar tools available for NDK based application developers.

Bug: 33668201
Test: manual - debug malloc can be enabled using the new feature
Change-Id: Ia4bec0854cf4dc08446f1671494200f54ef366ee
2016-12-16 09:03:06 -08:00
Tamas Berghammer
b8f7c351b9 Zygote: Add invoke-with to zygote protocol
Add "--invoke-with" to the zygote connection protocol. It was
already understood as an argument by the zygote.

Bug: 33668201
Test: m
Change-Id: I59095f2ac542aadff78a7ff1dded86cf5f192707
2016-12-16 09:03:01 -08:00
Felipe Leme
c23397a647 Includes key/value on exception thrown when they're too large.
Bug: 33662416

Test: manual verification
Change-Id: I11436a8454cef5f63b0fb58919f2f02de6234f6b
2016-12-15 12:25:51 -08:00
Joe Onorato
1754d744a7 First checkin of incident reporting.
There are a few major pieces here:

incidentd
---------
This daemon (started by init) runs and accepts incoming requests to take
incident reports.  When prompted, it calls into various system services
and fills in an IncidentProto data structure, and then writes the report
into dropbox.

The next steps for incidentd:
    - Security review of SELinux policies. These will be a subset of
      the dumpstate permissions.  Until this is done, incidentd is
      not started at boot time.

incident
--------
This shell command calls into incidentd, and can initiate an incident
report and either capture the output or leave for dropbox.

incident_report
---------------
This host side tool can call adb shell with the correct parameters
and also format the incident report as text.  This formatting code
was left of the device on purpose.  Right now it's pretty small, but
as the number of fields increases, the metadata and code to do the
formatting will start to grow.

The incident_report command also contains a workaround to let it
work before incidentd is turned on by default.  Right now, it is
implemented to call adb shell dumpsys <service> --proto directly,
whereas in the future it will go through the full incidentd flow.

incident_section_gen
--------------------
A build-time tool that generates a stripped down set of information
about the fields that are available.

libincident
-----------
This library contains the code to connect to incidentd, and the
meta proto definitions that are used by the framework protos.
The basics are here now, but they are not fully fleshed out yet.
The privacy.proto file contains annotations that can go in the
proto file that we will later use to filter which fields are
uploaded, and which are used by local sources.  For example, a
device in a test lab is safe to upload much much more information
than a real user.  These will share the same mechanism, but the
user's output will be filtered according to these annotations.

frameworks/core/proto
---------------------
These .proto files contain the definitions of the system's
output.  There is one master android.os.IncidentProto file that
is the top level of an incident report, but some other services
(notification, fingerprint, batterystats, etc) will have others
that are used directly by the logging mechanism.

Other files which are shared by several of the services also go
here, such as ComponentName, Locale, Configuration, etc.  There
will be many more.

There is also a first iplementation of a dump method handling
--proto in the fingerprint service.

IncidentManager
---------------
The java API to trigger an incident report.

Test: Not written yet
Change-Id: I59568b115ac7fcf73af70c946c95752bf33ae67f
2016-12-15 11:23:05 -08:00
Joe Onorato
de5b027d2c Add a native class to interact with DropBoxManager.
Test: Not written yet
Change-Id: I63ed888bd76f75c78a244a1bffae2d26f3b5f055
2016-12-15 11:23:05 -08:00
Kweku Adams
c6bd4243a4 Fixing issue in current and max duration calculations.
It looks like one operation was done out of order and some of the times used in
the calculations were leading to incorrect results.

BUG: 31023263
Test: bit FrameworksCoreTests:com.android.internal.os.BatteryStatsDurationTimerTest

Change-Id: I417cc28c5a55748067b6c7f682a66fe3dbc09f09
(cherry picked from commit 47db5a8bf7)
2016-12-14 21:54:48 +00:00
Esteban Talavera
06fd71abdf Merge "Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions" 2016-12-14 19:16:26 +00:00
Kweku Adams
47db5a8bf7 Fixing issue in current and max duration calculations.
It looks like one operation was done out of order and some of the times used in
the calculations were leading to incorrect results.

BUG: 31023263
Test: bit FrameworksCoreTests:com.android.internal.os.BatteryStatsDurationTimerTest

Change-Id: I417cc28c5a55748067b6c7f682a66fe3dbc09f09
2016-12-13 19:17:44 +00:00
Esteban Talavera
6c9116a643 Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions
Bug: 31952368

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest    frameworks-services
Test: runtest -c com.android.server.pm.UserManagerTest frameworks-services
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.UserRestrictionsTest

Change-Id: I240ab99c2409bbabffbc574bef202f2457026905
2016-12-13 18:14:19 +00:00
Lenka Trochtova
12b0496944 Make UserManager#DISALLOW_OEM_UNLOCK a system API.
This is needed for unbundling of OobConfig app.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testDisallowOemUnlock_canSetWithSystemApi
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testDisallowOemUnlock_doCannotSet

BUG: 32974379

Change-Id: I7710df96006821a5d0eddfe0b411dd3efa0e10f0
2016-12-13 15:10:38 +01:00
Josh Gao
bf249c1357 Merge "Add trace category for adb." am: 6968d90dc5 am: 15dc5951e6 am: 96446b5bd3
am: 19c4422c7c

Change-Id: I33a39902df365cf60cd5976d7977e18d36c09bc0
2016-12-13 01:10:22 +00:00