Commit Graph

3871 Commits

Author SHA1 Message Date
Daichi Hirono
baa0116854 Remove StorageManager#mountAppFuse hidden API.
The API should be replaced with StorageManager#openProxyFileDescriptor.

Bug: 32891253
Test: build
Change-Id: Ibbf8b64f3a39900a1f05a52132aa931491d6fd48
2017-01-23 09:36:59 +09:00
TreeHugger Robot
af6668bc9d Merge "resolve merge conflicts of 5fa7fb1d9f to master" 2017-01-21 02:41:19 +00:00
TreeHugger Robot
5feefa54c4 Merge "Introduce RescueParty." 2017-01-21 02:22:43 +00:00
Jesse Hall
3bb7e5c909 resolve merge conflicts of 5fa7fb1d9f to master
Test: make
Change-Id: I7f119535a120303796fcd08f0274269f7d0dbaba
2017-01-20 17:04:48 -08:00
Jeff Sharkey
fe6f85cac9 Introduce RescueParty.
When a device gets stuck in a crash loop, it's pretty much unusable
and impossible for users to recover from.

To help rescue devices from this state, this change introduces a new
feature that watches for runtime restart loops and persistent app
crash loops, and escalates through a series of increasingly
aggressive rescue operations.  Currently these rescue levels walk
through clearing any experiments in SettingsProvider before finally
rebooting and prompting the user to wipe data.

Crash loops are detected based on a number of events in a specific
window of time.  App stats can be stored in memory, but boot stats
need to be stored in system properties to be more robust.

Start up RecoveryService much earlier during the boot so we can
reboot into recovery when needed.

Add properties tha push system_server or SystemUI into a crash loops
for testing purposes.

Test: builds, boots, forced crashing walks through modes
Bug: 24872457, 30951331
Change-Id: I6cdd37682973fe18de0f08521e88f70ee7d7728b
2017-01-20 17:36:38 -07:00
Jeff Sharkey
f5d2c7278e Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741 am: c3fbf32011 am: 4a0a4664b9
am: 7bb9ccc1e5

Change-Id: I9346a576d57c9f7093b875c4a43134f2ef095018
2017-01-20 23:12:19 +00:00
Jeff Sharkey
7bb9ccc1e5 Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741 am: c3fbf32011
am: 4a0a4664b9

Change-Id: I9b5667ca6e5497a4eedaaf88979a1a3d0e22c174
2017-01-20 23:03:40 +00:00
Jeff Sharkey
a2ef6b5741 Merge "Add Binder support for Parcelable exceptions." 2017-01-20 22:45:04 +00:00
Jesse Hall
5fa7fb1d9f Load EGL early in Activity launch, instead of in Zygote
Preloading EGL in Zygote was originally a memory footprint
optimization, but it turns out to be an important app startup time
optimization as well. Preloading EGL in Zygote is incompatible with
updatable graphics drivers, but we don't want to do it on-demand as
part of drawing the first frame either, since that increases
first-frame latency unacceptably.

This change removes Zygote preload, and instead loads EGL on a
low-priority background thread immediately after choosing which
graphics driver to use. This means it is usually done well before
drawing the first frame, without significantly disrupting other
activity launch work.

Test: observe systrace of Calculator launch on bullhead
Bug: 34404021
Change-Id: I887aa09bd35b088b16f53a89838a0c7c98f15761
2017-01-20 13:50:41 -08:00
Jeff Sharkey
8e8269fc11 Merge "StrictMode to detect untagged network traffic." 2017-01-20 17:31:59 +00:00
Jeff Sharkey
619a511d4f StrictMode to detect untagged network traffic.
Network usage is tracked by the kernel at the UID level, which is
granular enough for normal apps, but large components (such as the
system server) are impossible to debug without adding additional
socket tagging to help identify subsystems within a UID.

To help ensure that system components tag all their network traffic,
this change offers a new StrictMode option to detect and report
untagged sockets.

Test: builds, boots, all common traffic tagged
Bug: 30943431, 30414041
Change-Id: I825c7941076054732264690247de2863342638e2
2017-01-19 20:52:05 -07:00
Jeff Sharkey
032c08ad6b Simplify FileUtils.stringToFile().
Convert to byte[] directly instead of using heavier FileWriter.

Test: builds, boots
Bug: 34364961
Change-Id: If0c09a924cd73f2c4965ac9d206f9c060788d27c
2017-01-19 17:11:55 -07:00
TreeHugger Robot
b55db281da Merge changes I1606b184,Id78dd4ab
* changes:
  Publish StorageManager#openProxyFileDescriptor API.
  Add StorageManager#openProxyFileDescriptor.
2017-01-19 02:15:34 +00:00
Tao Bao
8fe4df9fba Merge "Revert "RecoverySystem: Fix the issue in installPackage()."" am: 9311dbf9e4 am: 731445ebf7 am: b20ce70cca
am: 0770c86e5c

Change-Id: If50d623f41ccf8b5fa8756957b3479fdedaffc41
2017-01-19 02:08:27 +00:00
Tao Bao
0770c86e5c Merge "Revert "RecoverySystem: Fix the issue in installPackage()."" am: 9311dbf9e4 am: 731445ebf7
am: b20ce70cca

Change-Id: I931ce2f47714032b27cb092699ae3fbc69563fc0
2017-01-19 02:04:18 +00:00
Tao Bao
cc76991f37 Revert "RecoverySystem: Fix the issue in installPackage()."
This reverts commit 9f7a0acd2d.

Bug: 34350643
Bug: 34396955
Test: installPackage() doesn't cause deadlock if it doesn't call
      processPackage() prior to that.
Change-Id: I1da055c86a3326ae341da1b4d5dc79ab4be256fb
2017-01-19 01:31:57 +00:00
Daichi Hirono
500bffdba9 Publish StorageManager#openProxyFileDescriptor API.
Bug: 29970149
Test: Build succeeded
Change-Id: I1606b184968839fb99744387dcc058f15f6521c8
2017-01-19 09:30:58 +09:00
Daichi Hirono
9fb00183a0 Add StorageManager#openProxyFileDescriptor.
The CL:

 * Adds StorageManager#openProxyFileDescriptor API.
 * Turns IProxyFileDescriptorCallback into a class so that it can provides
   default implementations.
 * Removes mActive state from FuseAppLoop, because the state will be managed at
   the MountService side.
 * Adds StorageManagerIntegrationTest to check if FUSE is correctly mounted or
   not. Since it's implementation details, CTS does not help to test the
   behavior.

Test: StorageManagerIntegrationTest
Bug: 29970149

Change-Id: Id78dd4abcf9325820e9c77c264f54bfa77b85a92
2017-01-19 09:24:00 +09:00
Pavel Grafov
eaed75d923 Merge "Make ENSURE_VERIFY_APPS global even when set by PO." 2017-01-18 11:15:28 +00:00
Xiaohui Chen
387c65f639 Add build flag for container builds
Test: lunch and build
Bug: 34350397
Change-Id: Ideb14200b5056449055ca17d868c615548445dc9
2017-01-17 15:12:26 -08:00
Jeff Sharkey
e628b7d446 Add Binder support for Parcelable exceptions.
If an Exception thrown by a Binder call implements the Parcelable
interface, then parcel it and rethrow back at the caller.  There is
strict requirement that these Parcelable exceptions must be defined
by the system (as determined by checking the ClassLoader).  We prefix
the Parcelable contents with a length so that native code can skip
over the blobs.

Define a new ParcelableException class that can be used to transport
exceptions that cannot be modified to add Parcelable behavior, and
switch ExceptionUtils to use this new class for sending IOExceptions.

Test: builds, boots, wrapped exceptions work
Bug: 33749182
Change-Id: I1352ea1566ddf01120d9d0e819ba6f70fc407e11
2017-01-17 14:22:07 -07:00
Lorenzo Colitti
e00c7dd3fc Merge "Delete dead code." am: cf59ff79c5 am: d305a7c894 am: 8cf7169564
am: bb79257dbf

Change-Id: I97102d587cfc8699fd36f18e4072a5baaa7e2d11
2017-01-17 07:01:18 +00:00
Tao Bao
877d099ab4 Merge "RecoverySystem: Fix the issue in installPackage()." am: 3b2fe9f7b9 am: 6bb3a9e6df am: 5c610492c8
am: 448716eec1

Change-Id: Ib36b7e990e7ae545f6b58f7a425c8f9aa19ad9aa
2017-01-17 06:55:46 +00:00
Martijn Coenen
c09025165a Merge "Add nullable parameter to readEmbeddedBuffer." am: c5e5442acd am: b529858c0b am: 714c8596ad
am: 098bbc455d

Change-Id: I44b1ed7a8561ee234d6a55a9ed02eb3876c4a7fc
2017-01-17 06:50:39 +00:00
Lorenzo Colitti
bb79257dbf Merge "Delete dead code." am: cf59ff79c5 am: d305a7c894
am: 8cf7169564

Change-Id: Ia662fd845fcfb4ade631d8aacf6bcff3c92a1543
2017-01-17 06:08:28 +00:00
Treehugger Robot
cf59ff79c5 Merge "Delete dead code." 2017-01-17 05:44:58 +00:00
Tao Bao
448716eec1 Merge "RecoverySystem: Fix the issue in installPackage()." am: 3b2fe9f7b9 am: 6bb3a9e6df
am: 5c610492c8

Change-Id: Ic9fa3bb8c7d4c04fa6e55b600cd7cccc9b186db1
2017-01-16 18:36:43 +00:00
Pavel Grafov
6a40f09083 Make ENSURE_VERIFY_APPS global even when set by PO.
Currently only device owner can set global user restrictions.
With this CL ENSURE_VERIFY_APPS will be global no matter who
enforces it, DO or PO.

To make it possible for system apps to check who enforces a
particular restriction in this case a new API method is added
to UserManager: getUserRestrictionSources which returns a list
of users who enforce the restriction.

Bug:31000521
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.UserRestrictionsTest (ag/1732744)
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Test: installed M on a Nexus5x device, created a managed profile with some user restrictions, and checked that after upgrading M->O all restrictions are preserved and split correctly into base, global and local.
Change-Id: I543d3ec9ef0cf2b730da6f7406021c0bba43b785
2017-01-16 18:29:01 +00:00
Tao Bao
3b2fe9f7b9 Merge "RecoverySystem: Fix the issue in installPackage()." 2017-01-16 18:19:25 +00:00
Martijn Coenen
098bbc455d Merge "Add nullable parameter to readEmbeddedBuffer." am: c5e5442acd am: b529858c0b
am: 714c8596ad

Change-Id: I792c4ac6a20e4665b152a5ebea1227b549cca7ef
2017-01-16 15:06:01 +00:00
Jesse Hall
17ee3aac28 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Test: various apps w/ and w/o driver package installed
Change-Id: I5820d3d1301d5461e10706f551b268c54d4f8926
(cherry picked from commit b12249b671)
2017-01-15 05:55:46 +00:00
Jesse Hall
b12249b671 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Test: various apps w/ and w/o driver package installed
Change-Id: I5820d3d1301d5461e10706f551b268c54d4f8926
2017-01-14 17:31:56 -08:00
Tao Bao
9f7a0acd2d RecoverySystem: Fix the issue in installPackage().
Commit 794c8b0b3f fixed the race condition
when requesting data wipes via uncrypt. We have similar issue with
RecoverySystem.installPackage(). It first requests to set up the BCB,
then triggers a reboot. These two steps should finish atomically.

This CL switches to calling
RecoverySystemService.rebootRecoveryWithCommand(), which guards the two
steps with synchronized blocks.

Bug: 34239871
Test: Having two apps: one calls RecoverySystem.cancelScheduledUpdate()
      continuously, and the other calls RecoverySystem.installPackage()
      just once. The install request should not be cancelled by the
      other.

Change-Id: I5ec56fcaa70eae7c33e3cc8e6cfc7472b935ce4e
2017-01-13 09:59:38 -08:00
Martijn Coenen
14fae06b60 Add nullable parameter to readEmbeddedBuffer.
To support reading embedded buffers that can be
nullptr (currently only in empty hidl_vec).

Bug: 34255213
Test: hidl_test_java
Change-Id: I72028f580b7863b6bfeb31a5c0f43deed36dfd64
2017-01-13 14:17:12 +01:00
TreeHugger Robot
b237ddcb84 Merge "Remove PO support from HardwarePropertiesManager" 2017-01-12 14:01:26 +00:00
Santos Cordon
f85ab8306f Add Brightness setting for VR Mode.
am: d6a5660a2c

Change-Id: If371f485471eb1ab0a3e07964c197cb9b8ef1c9f
2017-01-11 03:12:05 +00:00
Santos Cordon
e89ba5222c Merge "Add Brightness setting for VR Mode." 2017-01-11 03:02:02 +00:00
Santos Cordon
3107d29c8f 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.

Test: runtests frameworks-core
Test: Turn vr mode on and change brightness (should remain separate from
normal brightness)

Bug: 30984614
Change-Id: If3c3e81b592e0c6fd037e5783559683e5cb58379
2017-01-10 17:16:04 -08:00
Andrew Scull
54402aab14 Merge "Evict CE key on request and when work mode is turned off." 2017-01-10 13:20:49 +00:00
Santos Cordon
d6a5660a2c 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: If3c3e81b592e0c6fd037e5783559683e5cb58379
2017-01-09 17:33:14 -08:00
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
Polina Bondarenko
8503fd51e5 Remove PO support from HardwarePropertiesManager
Removed broken profile owner support from HardwarePropertiesManager and
documentation.

Bug: 32945942
Test: compile
Change-Id: Ie5a26a4c94c35f6d894eff57c996552406ddd723
2017-01-09 16:24:21 +01: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