Commit Graph

4415 Commits

Author SHA1 Message Date
TreeHugger Robot
d5d183ea90 Merge "Fix Handler.Callback.handleMessage javadoc." 2017-07-12 14:57:48 +00:00
Narayan Kamath
bef056732b Merge "Binder: Don't attempt to catch OutOfMemoryError" 2017-07-12 10:51:22 +00:00
Pavel Grafov
dcc535723a Fix Handler.Callback.handleMessage javadoc.
Currently arguments and return value annotations are applied to the
whole interface and aren't rendered at all:
https://developer.android.com/reference/android/os/Handler.Callback.html#handleMessage(android.os.Message)

Test: nothing to test.
Change-Id: I8cb44f7a6c339971b770e9bf769efee8294b4d28
Bug:36127602
2017-07-12 10:42:31 +00:00
TreeHugger Robot
c00c64c96a Merge "Move eSIM factory reset implementation to RecoverySystem" 2017-07-11 20:08:12 +00:00
qingxi
2f23151e97 Move eSIM factory reset implementation to RecoverySystem
This CL reverts the implementation of eSIM factory reset in
MasterClearReceiver and uses RecoverySystem#rebootWipeUserData to erase
eSIM data. Besides this, when the eSIM data isn't erased, we should call
EuiccManager#retainSubscriptionsForFactoryReset to let the fastboot know
that.

Bug: 62957212
Test: TreeHugger
Change-Id: I08ab9d53ec4fc73a65e8e7d0c39ac95b2d44d012
2017-07-11 10:35:29 -07:00
Bin Chen
d8aad5ac38 Merge "Fix typo in Parcel javadoc." am: ed0e6009df am: d29e275b5b am: 4d4b9a2ac6
am: 3f24335abf

Change-Id: I565836c25a2e932c75959f99aacd0955a201a668
2017-07-11 11:30:52 +00:00
Bin Chen
3f24335abf Merge "Fix typo in Parcel javadoc." am: ed0e6009df am: d29e275b5b
am: 4d4b9a2ac6

Change-Id: Ief5a7469fbf2161d116dc210f3aa007bb4d69455
2017-07-11 11:23:55 +00:00
Bin Chen
d29e275b5b Merge "Fix typo in Parcel javadoc."
am: ed0e6009df

Change-Id: I06d3ac4d00cfec5179ca6e636365617c644f9fcd
2017-07-11 11:10:23 +00:00
Bin Chen
b6b12b567d Fix typo in Parcel javadoc.
Change-Id: Ida05259143e86c15c2ed69eeb7566d39b60fa823
2017-07-11 11:01:44 +08:00
Narayan Kamath
2f6af94c8e Binder: Don't attempt to catch OutOfMemoryError
This will be caught by surrounding code and will result in an
abort that will contain details of the exception + the associated
state of each thread. Catching the OOME in this manner is
counter-productive because we're immediately allocating inside the
catch, which is likely to cause more problems (and obscure the original
exception) unless there was an intervening GC.

Bug: 62514767
Test: make

Change-Id: I5a17707036c832d65480f18989faaf6747a29877
2017-07-06 15:23:19 +01:00
Narayan Kamath
ac27936be5 Merge "Zygote: Fix race condition on package preloads." into oc-dr1-dev
am: 84e0f453d1

Change-Id: I34dc28cd87e5111fccff05893ddf5c1155ad8746
2017-07-06 11:36:41 +00:00
TreeHugger Robot
c276c79e83 Merge "Zygote: Fix race condition on package preloads." 2017-07-06 09:50:10 +00:00
TreeHugger Robot
969d492531 Merge changes from topic 'hackbod_completion'
* changes:
  Fix issue #63095854: adb shell cmd jobscheduler timeout reports...
  Add reporting of how jobs complete.
2017-07-06 02:02:21 +00:00
TreeHugger Robot
8b79475dff Merge "Allow timed wakelocks to be released gracefully." 2017-07-06 00:50:26 +00:00
Jeff Sharkey
291c32a7b7 Allow timed wakelocks to be released gracefully.
When using a reference-counted wakelock together with a timeout, we
can end up with an over-released wakelock which causes an app crash.

To mitigate this, only throw based on count of external
acquire/release events.

Bug: 62326550
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.PowerManager_WakeLockTest
Change-Id: I66480cb9798f9404ae3d45a70d68eae136d289de
2017-07-05 16:58:51 -06:00
Jeff Sharkey
a6bfeae295 Log Bundle statistics when too large.
When we have trouble pushing a saved instance state Bundle out of
a process, log high-level statistics to help narrow down where bloat
is coming from.

Bug: 62409379
Test: builds, boots, stats logged
Change-Id: Iaff01eaf31ff0fd4d0fde3da15e9526dac559af9
2017-07-05 16:50:26 -06:00
Narayan Kamath
bae484ad8e Zygote: Fix race condition on package preloads.
Before this change, ZygoteProcess.preloadPackageForAbi returned
as soon as the command was written to the zygote socket and not
after the preload completed. This meant that there was a small
window of time before the server side of the socket polled its FDs
where a second command could be written to the zygote socket. This
would lead to only one of the commands being processed and the
other being dropped. The client side of that socket would then wait
forever for a response and bring down the system once the watchdog
timeout was hit.

Example failure case :
--------------
system_server:send command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(preloadPackage)  // the fork command is dropped.

Example of normal operation :
------------------
system_server:send command(preloadPackage)
zygote:poll & process command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(fork)

This change makes preloadPackageForAbi synchronous, which ensures
that each POLLIN event corresponds to precisely one command.

Bug: 62886909
Bug: 13618569
Test: Manual
Contributed-By: yuqianyu@huawei.com

(cherry-picked from commit 24a3306c32)

Change-Id: I83faf974c9a70a6ab18323f692c1981784e4c56a
2017-07-05 17:53:20 +00:00
Narayan Kamath
24a3306c32 Zygote: Fix race condition on package preloads.
Before this change, ZygoteProcess.preloadPackageForAbi returned
as soon as the command was written to the zygote socket and not
after the preload completed. This meant that there was a small
window of time before the server side of the socket polled its FDs
where a second command could be written to the zygote socket. This
would lead to only one of the commands being processed and the
other being dropped. The client side of that socket would then wait
forever for a response and bring down the system once the watchdog
timeout was hit.

Example failure case :
--------------
system_server:send command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(preloadPackage)  // the fork command is dropped.

Example of normal operation :
------------------
system_server:send command(preloadPackage)
zygote:poll & process command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(fork)

This change makes preloadPackageForAbi synchronous, which ensures
that each POLLIN event corresponds to precisely one command.

Bug: 62886909
Bug: 13618569
Test: Manual
Contributed-By: yuqianyu@huawei.com

Change-Id: I83faf974c9a70a6ab18323f692c1981784e4c56a
2017-07-05 18:28:54 +01:00
John Reck
707108b4ef Fix memory file constructor
Test: builds
Change-Id: Ib449eac18ca73e5e681190adfbf6b0ab28ee0482
2017-06-29 15:07:12 -07:00
John Reck
4dbcd23b5a Merge "Add SharedMemory API" 2017-06-29 17:35:17 +00:00
TreeHugger Robot
94eb534881 Merge "Parcel: Use @CriticalNative when possible." 2017-06-29 00:52:27 +00:00
Dianne Hackborn
94326cb56a Add reporting of how jobs complete.
In both battery stats and job scheduler statistics, keep track of
the reason jobs are ending.  This can help to identify apps that
are having bad behavior with jobs (in particular, regularly timing
out their job instead of finishing it when done).

Test: manual
Change-Id: Icc12d5e0dc0df1906716e7d995c56d50a9fa148a
2017-06-28 17:44:00 -07:00
John Reck
dea6a02761 Add SharedMemory API
SharedMemory is parcelable and AIDL friendly
and exposes cool things like dropping write permissions
that are useful for shared memory to have.

Also exposes getFileDescriptor() on MemoryFile
since that was necessary to use MemoryFile
with IPC previously and there are a sizeable
number of reflections that access it, so just make
it public.

Test: SharedMemory CTS tests pass

Change-Id: I71a322abf2eb55267d7299a8e41f847339af8b08
2017-06-28 16:49:12 -07:00
Makoto Onuki
b148b6c3c8 Parcel: Use @CriticalNative when possible.
- Change some methods from FastNative to CritcialNative
- Change nativeGetBlobAshmemSize to CritcalNative

- ParcelPerfTest.java (CorePerfTests)
bullhead-userdebug + prep_buller.sh, mean(ns), changed methods only
-- After
timeGetDataCapacity_mean    166 +39.16%
timeGetDataPosition_mean    169 +53.25%
timeReadByte_mean           296 +39.86%
timeReadLong_mean           284 +61.97%
timeSetDataPosition_mean    173 +34.10%
timeGetDataSize_mean        173 +37.57%
timeReadInt_mean            284 +57.04%

-- Before
timeGetDataCapacity_mean    231
timeGetDataPosition_mean    259
timeReadByte_mean           414
timeReadLong_mean           460
timeSetDataPosition_mean    232
timeGetDataSize_mean        238
timeReadInt_mean            446

Bug: 62135986
Test: bit CtsOsTestCases:android.os.cts.ParcelTest
Change-Id: I8c7ede25c87017ef2c7a49beaa3ac781c08ea365
2017-06-28 09:03:09 -07:00
Jeff Sharkey
5ab0243330 Only require that system UIDs tag their sockets.
Apps with a normal UID are typically isolated enough to not require
socket tagging; we're mostly interested in tracking down internal
UIDs that have lots of code sharing the same UID.

Also fix up everyone doing manual string checks of Build.TYPE, since
we now have first-class fields for those.

Bug: 38126076
Test: builds, boots
Change-Id: I3a40348196bd8459289f2b9355d9783a07f1e7dd
2017-06-27 11:11:06 -06:00
TreeHugger Robot
2789536500 Merge changes Ie79ce57c,I003dd7c9,Ibb0f4504
* changes:
  Assume virtual devices always have USB connection.
  Allocate well-known tag for app store updates.
  Add @TestApi for StrictMode tests.
2017-06-27 16:15:48 +00:00
Jeff Sharkey
ddc3bfddd4 Add @TestApi for StrictMode tests.
Bug: 62037127
Test: builds, boots
Change-Id: Ibb0f450400bc498c2b4d4fe3399c7e4d573eef60
2017-06-26 19:39:20 -06:00
Makoto Onuki
c36d04179a Merge "Merge "Log sync details to rotating log files (userdebug/eng only)" into oc-dr1-dev am: c4e8720eb2" into oc-dr1-dev-plus-aosp
am: 54805b7467

Change-Id: I8e6c29906a3d5f8814a89ad419146e5b8eff9e4c
2017-06-26 21:25:30 +00:00
Makoto Onuki
7edc7569b7 Merge "Log sync details to rotating log files (userdebug/eng only)" into oc-dr1-dev
am: c4e8720eb2

Change-Id: Ib24297e8ca16f1f9db5f6951438f4f7006e545c7
2017-06-26 21:15:26 +00:00
TreeHugger Robot
c4e8720eb2 Merge "Log sync details to rotating log files (userdebug/eng only)" into oc-dr1-dev 2017-06-26 20:58:29 +00:00
Jeff Sharkey
adcd1fe0f6 Merge "Progress towards FBE and adoptable storage." 2017-06-26 17:41:47 +00:00
Richard Uhler
a18500b508 Fix bug in reporting SwapPss in dumpsys meminfo.
am: a178205e8b

Change-Id: I49c805c6fab673008b18a5a8deb256ec2a5fb970
2017-06-26 09:01:32 +00:00
TreeHugger Robot
e59243772a Merge "Fix bug in reporting SwapPss in dumpsys meminfo." 2017-06-26 06:36:36 +00:00
Richard Uhler
a178205e8b Fix bug in reporting SwapPss in dumpsys meminfo.
Bug: 29875093
Test: Run dumpsys meminfo -a, verify SwapPss adds up and is non-zero
      for dalvik and native.

Change-Id: I79d0b6a59bf5f4e73f75f0b9540ec0fcc9e23b02
2017-06-26 06:34:04 +00:00
Jeff Sharkey
a65e6491e4 Progress towards FBE and adoptable storage.
Offer to adopt storage devices on FBE devices, but keep it guarded
behind a system property for now, since we still need to work out key
storage details.

Verify that all users are unlocked before moving apps or shared
storage.  We only need them to be unlocked; we don't need them to
be actually running.

Have PackageManager dump the set of volumes that it's finished
scanning and loading, since otherwise CTS can get excited and race
too far ahead of it.  Add a specific error code to communicate
that users are locked.

Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 37436961, 29923055, 25861755, 30230655
Change-Id: I749dc3d8148e1a95d8bc4be56665253ef826d3fe
2017-06-23 16:35:15 -06:00
Ying Xu
12148fa980 Merge "Add flag to wipe eUICC data" into oc-dr1-dev am: 05ce703c87
am: a465181691

Change-Id: I8a54d9ab00223155e473b7ea4683a48def627288
2017-06-23 21:14:22 +00:00
Ying Xu
a465181691 Merge "Add flag to wipe eUICC data" into oc-dr1-dev
am: 05ce703c87

Change-Id: I556f01f7f317e639f8a33a981154721e53a95641
2017-06-23 21:04:25 +00:00
Ying Xu
05ce703c87 Merge "Add flag to wipe eUICC data" into oc-dr1-dev 2017-06-23 20:52:56 +00:00
Makoto Onuki
a9dca2483e Log sync details to rotating log files (userdebug/eng only)
Bug 62052247
Test: Manual test with setting debug.synclog to 0 and 1.

Change-Id: I553dc8d3457ae99cbca5bf6a74303b8a8d8817e7
2017-06-23 12:21:58 -07:00
yinxu
f4f9cec234 Add flag to wipe eUICC data
Add a new flag in the DevicePolicyManager so that we can Use
EuiccManager#eraseSubscriptions(PendingIntent) to erase all the carrier data
from eUICC chip if the user choose to "ERASE" from the Android device manager.

Bug: 37277944
Test: E2E
Change-Id: Ia78090a00d956c645725be4fd591e02ded8ec467
2017-06-23 10:56:55 -07:00
Richard Uhler
91702eb391 Fix bug in reporting SwapPss in dumpsys meminfo.
Bug: 29875093
Test: Run dumpsys meminfo -a, verify SwapPss adds up and is non-zero
      for dalvik and native.

Change-Id: I79d0b6a59bf5f4e73f75f0b9540ec0fcc9e23b02
2017-06-23 16:54:25 +01:00
Vladimir Marko
45faa6a41b Merge "Merge "Rename Binder.destroy() to Binder.destroyBinder()." am: a634b38c8e am: 1b4b326128 am: 17bb92fe14" into oc-dr1-dev-plus-aosp
am: 3ec8fd13f8

Change-Id: Ib21b4d3a88558971a51f31f16f9f57e1e54b3fb9
2017-06-23 13:06:38 +00:00
Vladimir Marko
8c120b8eb5 Merge "Rename Binder.destroy() to Binder.destroyBinder()." am: a634b38c8e am: 1b4b326128
am: 17bb92fe14

Change-Id: I08ab885e0b4373074e5eba3d36dcbb73c87458dc
2017-06-23 12:45:17 +00:00
Vladimir Marko
17bb92fe14 Merge "Rename Binder.destroy() to Binder.destroyBinder()." am: a634b38c8e
am: 1b4b326128

Change-Id: I165243924444f89ee880072c55eba012ccf1d149
2017-06-23 10:55:48 +00:00
Vladimir Marko
a634b38c8e Merge "Rename Binder.destroy() to Binder.destroyBinder()." 2017-06-23 10:36:02 +00:00
Joel Scherpelz
08dbbc24cc Merge "Use RFC 7217 stable privacy addresses" am: a88b12ce5e am: 4c4d5477d4 am: 8a4667b911
am: 7019b5aa81

Change-Id: I03ddd946247bc9d3b321be4eedf225ad4209e6d4
2017-06-22 19:55:02 +00:00
Joel Scherpelz
7019b5aa81 Merge "Use RFC 7217 stable privacy addresses" am: a88b12ce5e am: 4c4d5477d4
am: 8a4667b911

Change-Id: I60e9d4e630ffb6f6ff6870102d4620c5c4c81c47
2017-06-22 19:38:18 +00:00
Vladimir Marko
b25a532358 Rename Binder.destroy() to Binder.destroyBinder().
There are a few AIDL-generated stubs that perform "destroy"
transactions and call "this.destroy()". Previously, this
resolved to the "destroy()" method from their interface on
ART while resolving to Binder.destroy() on the RI, though
this is a subject of a bug report against the JDK,
    http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8021581 .
Resolving to the private Binder.destroy, inaccessible to
the Stub, would lead to throwing IllegalAccessErrror.

As we're changing the method lookup to be closer to RI, see
    https://android-review.googlesource.com/413119 ,
we should stay clear of the problematic cases whether we
make a decision to follow the RI precisely or not. Therefore
we rename the Binder.destroy() to Binder.destroyBinder().

Test: Nexus 6P boots.
Bug: 62855082
Change-Id: I43baf76b6f3c681d93b411cecf2bc00fccafecac
2017-06-22 14:38:23 +01:00
Joel Scherpelz
8a4667b911 Merge "Use RFC 7217 stable privacy addresses" am: a88b12ce5e
am: 4c4d5477d4

Change-Id: I7f286484a31c7209e48e93a94d2a16849af6dace
2017-06-22 06:48:09 +00:00
Joel Scherpelz
2db1074e4f Use RFC 7217 stable privacy addresses
Ask Netd to setup WiFi interfaces to use stable privacy addresses. This
should fail benignly on devices with kernels lacking RFC 7217 support.

Test: as follows
    - built
    - flashed
    - booted
    - Manually observed persistent stable secret
    - Manually observed randomized IPv6 addresses (with flags = 800)
Bug: 17613910

Change-Id: I9465de16685b1eb0fd842446a530cf98d77a0c28
2017-06-22 13:31:06 +09:00