Prevously MtpDocumentsService was started as background service, then it
turns into a foreground service by calling Service#startForeground.
The workflow did not work until this, because now background activity
cannot launch a background service.
The CL starts using NotificationManager#startForegroundService to launch
MtpDocumentsService so that the service can be started as foreground
service directly.
Bug: 34468813
Test: MtpDocumentsProviderTests
Test: manual testing with connecting MTP device to Android
Change-Id: Ic35d3e92f234881846e5d82ed04d6681a83035f7
AppFuse is now a public API. The CL removes the private version from
MtpDocuemntsProvider package and switches to the public version.
Bug: 32891253
Test: MtpDocumentsProviderTest
Change-Id: Ibdf67309bc0678e2f70ac2dddb920125d9e0760e
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.
Bug: 30188076
Test: make checkbuild
Change-Id: I13e88297731253420e4e5f5291d503f13a39a156
Update DocumentsProvider to override
ContentProvider#query(Uri, String[], Bundle, CancellationSignal);
Added an otherwise unneeded import to pass doc check
on DocumentsProvider.
Bug: 30927484
Change-Id: I295c21f53901d567455286f22439f21d22a8a25a
Test: Build and run. Test from DocsUi.
The structure of files in MtpDocumentsProvider looks like
/device/storage/files. But MtpDocumentsProvider shows files
just under the device if the device has only single storage.
It causes a problem that MtpDocumentsProvider tries to create a file
under the device. Previously it tries to create a file with storageId =
0, which means MTP device choose a storage to store the file.
Because it only happens when the device has a single storage, the file
is properly written to the device. But the database in
MtpDocumentsProvider goes into the illegal state where the file is
placed just under the device.
Bug: 32561572
Test: adb shell am instrument -w -e class com.android.mtp.MtpDocumentsProviderTest com.android.mtp.tests/com.android.mtp.TestResultInstrumentation
Change-Id: I47a373ceee8a64ba9995934317693e79d2497ee0
Previously we have two AppFuseTest class in the normal test and the perf
test. The CL renames the one in the perf test to different name.
Bug: 31982374
Test: adb shell am instrument -w com.android.mtp.perftests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I6272d7f78cead0bfeee7cf83ed50c77658caa1c0
The perforamnce test read from/write to 10MB data to AppFuse file 100
times.
Test: adb shell am instrument -w com.android.mtp.perftests/android.support.test.runner.AndroidJUnitRunner
Bug: 31982374
Change-Id: I8f78ee43d8078d7f1098249b28491cb43b5f3bef
The flag indicate whether the root needs network access or not. MTP
should be LOCAL_ONLY root.
Bug: 30867267
Change-Id: Ia272d4a389cc1ca628d7b963caa37f3dbb6747e3
(cherry picked from commit 83c679e7221460fc50e91402a34787e1866d94ef)
The flag indicate whether the root needs network access or not. MTP
should be LOCAL_ONLY root.
Bug: 30867267
Change-Id: Ia272d4a389cc1ca628d7b963caa37f3dbb6747e3
ag/1241051 explicitly specified the primary mime type for MTP format
code. And it changes mime type for MtpConstants.FORMAT_MPEG from
video/mp4 to video/mpeg.
FIX=30266226
Change-Id: I362bd7d651140b9928aa76e0d54e4769296d9498
am: b8995b7abc
* commit 'b8995b7abc9cbaa1dcb363c68535a63f4e8768a3':
Don't show new-window item in Downloads per Gabe.
Change-Id: I54d288582f474ed1a0718a3f6327af7f1814be75
Also, fix regression...don't show "internal storage" option in Downloads.
All other modes, fix inconsistencies in presentation of
internal-storage/new-windows commands by eliminating launch mode inference.
Update VolumeInfo and MTP provider to send correct launch mode extra.
Bug: 28691735,28695347
Change-Id: Ic480925f4c8f1beee4da104a2259c1ce5f28a6a1
The policy value 'enable' does not exist anymore
and was replaced by 'always'
(cherry-picked from 2a6b5c63c04b819950cec466c8bb6da61270af22)
Change-Id: I233a555821a84d917e3b3ec923b5baffc18bd2d2
Currently AppFuse tries to terminate its message loop when it receives
FUSE_FORGET. But kernel continues to dispatch messages after FUSE_FORGET
and it should not terminate AppFuse meesage loop.
Change-Id: I070a71c35a8d80bcaaf7603305d219e65be97bc9
Fixes: 28508169
Previously MTP notification shows a message "don't disconnect the
device". But there is no unmount button for MTP. Because it's safe to
disconnect MTP device after completing file operations, we remove the
message from MTP notification.
Change-Id: I78b7649e3a9982c02b0312d221d395e9ac799318
Fixes: 28194216
* Check null result for all MTP APIs that can return null.
* Don't regard valid parent handles that are more than 0x80000000 as
error.
* Check boolean result from importFile.
Change-Id: I262511ac3c935ebb54e52c03eaefd3535a3e2f29
Fix: 28155538
For testing, we use blockDocument and unblockDocument test mehtods to
control flow of DocumentLoader's background thread.
Previously testCancelTask may exit before the background thread goes
back from blocking, which causes InterruptedException.
Fixes: 28125289
Change-Id: Id03826733c5b6f1da66b9280838eb1d2897ed5fc