Commit Graph

4396 Commits

Author SHA1 Message Date
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
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
Dianne Hackborn
6a93509080 Merge "Work on issue #62065889: Assess thresholds and criteria for killing..." 2017-06-21 21:07:05 +00:00
Mathieu Chartier
1cd93b8f75 Merge "Disable activity leak detection by default for userdebug" into oc-dev am: 956ea5f09d am: 8d189593b8
am: 0681ebd58c

Change-Id: Ic0510ef945839d99ec27857b59e25d4e1cd8a911
2017-06-20 20:25:09 +00:00
Mathieu Chartier
0681ebd58c Merge "Disable activity leak detection by default for userdebug" into oc-dev am: 956ea5f09d
am: 8d189593b8

Change-Id: I8a24342b3c444072cc4cdcd8331fc7d78c804438
2017-06-20 20:12:04 +00:00
Mathieu Chartier
490bfbbc27 Merge "Disable activity leak detection by default for userdebug" into oc-dev
am: 956ea5f09d

Change-Id: I71d5feb7f558347ddb21dc53e7a7d5b9eda9db6d
2017-06-20 20:06:32 +00:00
Mathieu Chartier
8d189593b8 Merge "Disable activity leak detection by default for userdebug" into oc-dev
am: 956ea5f09d

Change-Id: Iadacd64e92c1963b2417bad96838ba2c128ec8cb
2017-06-20 20:05:29 +00:00
Mathieu Chartier
ca8c1051ed Disable activity leak detection by default for userdebug
Causes too many GCs and related slowdowns.
Verified that assistant launch from holding down home button is now
faster than N.

Test: make and flash
Bug: 62769566

Change-Id: Ib0c1f7a45831b241d3376d1e56db3c6937913b1b
2017-06-20 02:51:31 +00:00
Dianne Hackborn
ffca58bc5e Work on issue #62065889: Assess thresholds and criteria for killing...
...background processes (CPU, etc)

Add full configuration params for adjusting these settings (some were
already there).

Also...  as long as we are doing this...

- Get rid of all of the wakelock stuff.  That is completely pointless
now that we aren't even allowing cached processes to hold wake locks.

- This greatly simplifies the code, since we don't need to deal with
two different policies for how we do checks.  Instead, we just regularly
check for CPU and the CPU check interval.

- And make the CPU check more aggressive and have much more flexibility
for tuning: there are now 4 different maximum CPU use levels, depending
on how long the process has been in the cached state.  This allows us to
be more strict on CPU use the longer it is sitting in the background.

Note that CPU use tracking only happens while the device is not
plugged in to power...  I'll leave this for now, but I think in the
future we should think about applying these limits even when plugged
in, because in either case cached apps should really not be doing
much.

Test: manual
Change-Id: I68f4ab68be5f7d5fc4822005107fb60ef07a374d
2017-06-19 16:55:45 -07:00
Alessio Balsini
1d9bba2ac5 Merge "Documentation: changed tid parameter description for getThreadPriority()" am: 663b02dd28 am: 6f0adbfaea am: fd88d146b4
am: 537782f395

Change-Id: I38896f0929aabf60444882a79cda6ae8290763f3
2017-06-19 12:15:41 +00:00
Alessio Balsini
537782f395 Merge "Documentation: changed tid parameter description for getThreadPriority()" am: 663b02dd28 am: 6f0adbfaea
am: fd88d146b4

Change-Id: Iab127e59a59c959e9cd100dff68f415415b0bcce
2017-06-19 12:04:37 +00:00
Alessio Balsini
fd88d146b4 Merge "Documentation: changed tid parameter description for getThreadPriority()" am: 663b02dd28
am: 6f0adbfaea

Change-Id: I0626fb2d9de978f204ba9898a56e4225a71f03e8
2017-06-19 11:54:05 +00:00
Alessio Balsini
68ae301831 Documentation: changed tid parameter description for getThreadPriority()
Wrong description of the "tid" parameter used by getThreadPriority():
the function does not "change" the priority of the thread associated to 
"tid".
Defined also the meaning of setting tid parameter to 0.


Test: None

Change-Id: I8552f3b110eaab1aefa51477e82d3e295547be34
Signed-off-by: Alessio Balsini <alessio.balsini@gmail.com>
2017-06-19 08:48:14 +00:00
Dianne Hackborn
5462042385 Merge "Work on issue #36891897: Need to ensure foreground services..." into oc-dev am: ef0554438f am: 84795f778b
am: 56617fd24f

Change-Id: I0051a01a498d77e0dea10ce31c51912b7747b551
2017-06-15 19:08:07 +00:00
Dianne Hackborn
56617fd24f Merge "Work on issue #36891897: Need to ensure foreground services..." into oc-dev am: ef0554438f
am: 84795f778b

Change-Id: I90d6e150b6dcfe7665b5c1b7db84dd04a7d0d824
2017-06-15 19:01:41 +00:00
Dianne Hackborn
92cc8d3816 Merge "Work on issue #36891897: Need to ensure foreground services..." into oc-dev
am: ef0554438f

Change-Id: I5d25640507d4c4cf61f64638d27ddf0cac67f880
2017-06-15 18:52:18 +00:00
Dianne Hackborn
84795f778b Merge "Work on issue #36891897: Need to ensure foreground services..." into oc-dev
am: ef0554438f

Change-Id: I39ad3ffce83c1817bdc8aa7ab9f623d1b683d983
2017-06-15 18:52:07 +00:00
Dianne Hackborn
cb01563d7e Work on issue #36891897: Need to ensure foreground services...
...can't hide themselves

Tune the policies for when we tell about apps running in the
background after their services have stopped.

- If it ran while the screen was on, the time we require for it
to be running is much shorter (a couple seconds) as well as the
time we tell about it having run (with another tunable for the
minimum time we tell about this).

- If it has only run while the screen is off and stops a sufficient
amount of time before the screen goes on (currently a second) then
we will not show anything when the screen goes on.

- If it stops when the screen turns on, we will make sure the user
sees about it for a short period of time (currently 5 seconds).

Also includes some improved debug output about handler message
queues.

Test: manual

Change-Id: Iab438410d7182b2dfe4f9c1cce7069b26b34834c
2017-06-14 17:33:41 -07:00
TreeHugger Robot
57fef233c8 Merge "BatteryStats: Cleanup external stats collection" 2017-06-13 17:29:15 +00:00
Jeff Sharkey
a915a88cfb Merge "Merge "Improve developer docs for storage APIs." into oc-dev am: 05b52d8ba5 am: f96c9a0fa2" into oc-dr1-dev-plus-aosp
am: 08b598fcfe

Change-Id: I6dd330a240f1725b59e79111fd3bfc124a3fb897
2017-06-13 00:57:38 +00:00
Jeff Sharkey
0ba24ed694 Merge "Improve developer docs for storage APIs." into oc-dev
am: 05b52d8ba5

Change-Id: I282786d353e3dc406c7123daa00d3e7fe43de7bc
2017-06-13 00:36:09 +00:00