Commit Graph

4443 Commits

Author SHA1 Message Date
Michael Wachenschwanz
892a361372 Merge "Add Foreground Service Timer" 2017-07-17 22:59:48 +00:00
TreeHugger Robot
080838c0a4 Merge "Test if allocation supported; @removed clean up." 2017-07-16 05:18:36 +00:00
Jeff Sharkey
4233f032fd Test if allocation supported; @removed clean up.
SM.allocateBytes() doesn't offer a clear way to detect if a failed
request could ever succeed.  (For example, we can never work with
pipes, or files on an unsupported storage device.)  So give
developers a first-class API to test if allocation is supported.

If the underlying filesystem doesn't support fallocate(), fall back
to ftruncate() instead of failing completely.

Clean up @removed APIs that were refactoring during API 26 review
process.

Remove support for storing downloads on the /cache partition, which
doesn't exist on many devices.

Bug: 63057877
Test: bit DownloadProviderTests:*
Test: bit DocumentsUITests:com.android.documentsui.services.CopyJobTest
Test: bit DocumentsUITests:com.android.documentsui.services.MoveJobTest
Change-Id: I85d42a1a7240034b4f2a6f359011ac182bdce36e
2017-07-15 21:08:56 -06:00
Mathieu Chartier
1b45fcd14e Merge "Add more details to dumpsys meminfo -d" 2017-07-14 20:58:13 +00:00
Jeff Davidson
59eeffcb09 Merge "Temporarily disable eUICC factory reset handling." into oc-dr1-dev am: c0ce489df7
am: 7183acc20e

Change-Id: I63232bdcde7bf4050140c20e41afc9e91bfb3b5f
2017-07-14 20:13:31 +00:00
Jeff Davidson
7183acc20e Merge "Temporarily disable eUICC factory reset handling." into oc-dr1-dev
am: c0ce489df7

Change-Id: Iea42444468b78c604f32ffd4a47eb8a1c762d2ab
2017-07-14 20:07:26 +00:00
Jeff Davidson
7615d11dd4 Temporarily disable eUICC factory reset handling.
This seems to be causing users who elect not to wipe their eUICC on a
factory reset to end up on the eSIM slot after the reset instead of
the pSIM slot.

Bug: 63693573
Test: TreeHugger + factory reset local test
Change-Id: I414a16cde11e76ccc390e7a63a6803f5b402fe78
2017-07-14 10:21:32 -07:00
Mathieu Chartier
95550dd394 Add more details to dumpsys meminfo -d
Added new subitems for
.dex:
boot vdex
app vdex
app odex

.art
app art
boot art

Fixed accounting for dalvik other to be subitems of other subsection
instead of dalvik.

Sample output:
261,892K: Native
213,196K: .dex mmap
    111,620K: .App vdex
    65,070K: .App dex
    36,506K: .Boot vdex
192,320K: EGL mtrack
161,835K: .so mmap
134,922K: .apk mmap
85,612K: Dalvik
    74,656K: .Heap
    4,526K: .Zygote
    4,218K: .LOS
    2,212K: .NonMoving
64,906K: Unknown
52,119K: .oat mmap
42,828K: Dalvik Other
    32,704K: .LinearAlloc
    3,672K: .JITCache
    3,248K: .IndirectRef
    3,204K: .GC
40,754K: .art mmap
    31,133K: .Boot art
    9,621K: .App art
21,976K: Other mmap
20,704K: Stack
16,270K: Gfx dev
9,200K: GL mtrack
3,428K: Other dev
2,744K: .ttf mmap
1,116K: Ashmem
1,052K: .jar mmap
0K: Cursor
0K: Other mtrack

Test: dumpsys meminfo -d
Test: dumpsys meminfo -s
Test: dumpsys meminfo
Test: dumpsys meminfo <pid>
Test: dumpsys memifno -d <pid>

Bug: 32331673

Change-Id: Ib46aac6c6cd23f8594d4d06d8651d83f04c0b4d7
2017-07-14 10:00:38 -07:00
Lorenzo Colitti
f7a008ff69 Merge changes Icc5aa605,If744f2e0,Ie1b5a5e4 into oc-dr1-dev am: 3756636ad6
am: 041111ff7e

Change-Id: I538f7faef85bbb13499dec2125e0f82b3175396f
2017-07-14 01:06:56 +00:00
Lorenzo Colitti
041111ff7e Merge changes Icc5aa605,If744f2e0,Ie1b5a5e4 into oc-dr1-dev
am: 3756636ad6

Change-Id: Ic1e799c17b4bb0272cf85e03d5ad14981a55defa
2017-07-14 01:01:29 +00:00
Lorenzo Colitti
3756636ad6 Merge changes Icc5aa605,If744f2e0,Ie1b5a5e4 into oc-dr1-dev
* changes:
  Add code to dump OffloadController state.
  Fetch tethering offload stats.
  Allow more than one source of tethering statistics.
2017-07-14 00:51:56 +00:00
Christopher Ferris
f003ae0f25 Merge "Implement dumpheap -m." 2017-07-13 20:10:47 +00:00
Timur Iskhakov
221024bead Merge "Add configureRpcThreadpool to java interface" am: d8dab11547 am: 791a698a6a am: 9cdec3943c
am: 1cdcaa8cf3

Change-Id: Iea02cb61c0a77eb3d94b9ebe63687457b6a5032c
2017-07-13 19:39:36 +00:00
Timur Iskhakov
1cdcaa8cf3 Merge "Add configureRpcThreadpool to java interface" am: d8dab11547 am: 791a698a6a
am: 9cdec3943c

Change-Id: Id3e2523a755e8ce207ac6bd85dbf6d5a69070207
2017-07-13 19:33:29 +00:00
Timur Iskhakov
791a698a6a Merge "Add configureRpcThreadpool to java interface"
am: d8dab11547

Change-Id: I958ef6fc2d667a691e39e9fadd07303085a499f9
2017-07-13 19:21:42 +00:00
Qingxi Li
02eab5653d Merge "Fix the error that the broadcast receiver cannot be registered" into oc-dr1-dev am: b7febbb727
am: 11ba1cb60a

Change-Id: Iebb4844baf119ae51749aab524184f35c208853d
2017-07-13 19:17:03 +00:00
Treehugger Robot
d8dab11547 Merge "Add configureRpcThreadpool to java interface" 2017-07-13 19:11:39 +00:00
Qingxi Li
11ba1cb60a Merge "Fix the error that the broadcast receiver cannot be registered" into oc-dr1-dev
am: b7febbb727

Change-Id: Ia16b14971d474bdab739368a83b5b119faeaa381
2017-07-13 19:08:27 +00:00
Qingxi Li
b7febbb727 Merge "Fix the error that the broadcast receiver cannot be registered" into oc-dr1-dev 2017-07-13 19:02:24 +00:00
Lorenzo Colitti
ef7b2a13ce Allow more than one source of tethering statistics.
Currently, netd is the only source of tethering statistics.
In order to support multiple sources, define a new
ITetheringStatsProvider interface that can be registered with
NetworkManagmentService. Convert the existing code into the
first ITetheringStatsProvider.

Bug: 29337859
Bug: 32163131
Test: builds, boots
Test: tethering stats continue to be collected
Change-Id: Ie1b5a5e47ae4bf5af922365b09fa241e834236e4
2017-07-13 23:34:25 +09:00
Michael Wachenschwanz
b05a3c5f20 Add Foreground Service Timer
Create a new timer to keep track of time spent in the Foreground Service
state. Expose said timer so Settings can use foreground service time in
its battery usage calculations.

Test: bit FrameworksCoreTests:com.android.internal.os.BatteryStatsNoteTest
Bug: 38313557
Change-Id: Ib30e9354665343262c6796c630b180a444bed88c
2017-07-12 18:06:35 -07:00
Timur Iskhakov
b6a6283ce4 Add configureRpcThreadpool to java interface
Bug: 36233029
Test: links, compiles, hidl_test_java

Change-Id: I7e2ec88b2098886983b1d93ab100a77db63f3976
2017-07-12 17:56:39 -07:00
Christopher Ferris
8d652f8f7e Implement dumpheap -m.
Adds an option to dumpheap that calls mallocInfo and write the xml produced
to a file.

Bug: 36871013

Test: Run am dumpheap -m <FILE>, am dumpheap -n <FILE>, am dumpheap <FILE>
Test: and verified that they produce the correct data.
Change-Id: Ifb9e878ea621c7cacc3aa6e3a889c414681dee2d
2017-07-12 16:06:20 -07:00
qingxi
aee0ab9eb9 Fix the error that the broadcast receiver cannot be registered
Factory reset of eSIM failed due to the euiccWipeFinishReceiver cannot
be registered by the context directly. This CL changes the context to
application context to solve this problem.

Bug: 63610700
Test: E2E
Change-Id: I7e4c8b75b5b5b4203efd7302677ffa5cf00198b5
2017-07-12 13:15:51 -07:00
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
Lorenzo Colitti
5e7b01c823 Merge "Use RFC 7217 stable privacy addresses" into oc-dr1-dev 2017-07-12 07:57:49 +00:00
qingxi
a6536cc85e Merge "Move eSIM factory reset implementation to RecoverySystem" into oc-dr1-dev
am: a249de50d1

Change-Id: I784617e0c34275adc5d177e6728b4b2c86dc1f5d
2017-07-12 02:31:24 +00:00
qingxi
e060ffd2ca 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
Merged-In: I08ab9d53ec4fc73a65e8e7d0c39ac95b2d44d012
Change-Id: I08ab9d53ec4fc73a65e8e7d0c39ac95b2d44d012
2017-07-11 13:09:40 -07: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