241 Commits

Author SHA1 Message Date
Daichi Hirono
203be491ef Use Context#startForegroundService in MTP provider
NotificationManager.startServiceInForeground() was moved to
Context#startForegroundService. MtpDocumentsProvider should use new one.

Bug: 36794559
Test: MtpDocumentsProviderTests
Change-Id: I84723ee8c3f0f8bfe4d5ea8ad035c01c42ce8bab
2017-04-07 11:13:56 +09:00
TreeHugger Robot
964244785d Merge "Fix MtpDocumentsProvider test." 2017-03-23 00:46:06 +00:00
Dan Shi
874a0916fc Merge "Add test configs to apct tests under frameworks/base" 2017-03-22 17:55:58 +00:00
Daichi Hirono
4e4ec1628d Fix MtpDocumentsProvider test.
ag/2008770 fixed the flag value for root document.
We also need to update expected value for MtpDocumentsProviderTest.

Bug: 35855598
Test: adb shell am instrument -w \
    com.android.mtp.tests/com.android.mtp.TestResultInstrumentation

Change-Id: I3ca7f08dc8f14b84c350dbc3ddd5a0ba5ff7d04f
2017-03-22 15:57:48 +09:00
Dan Shi
7f2afd2dff Add test configs to apct tests under frameworks/base
TouchLatency is needed by test TouchLatencyJankTestWear
UiBench is needed by test UiBenchJankTests

Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
make -j32 TouchLatency TouchLatencyJankTestWear  && \
tradefed.sh run template/local --template:map test=TouchLatencyJankTestWear \
      --test-tag testname --log-level-display VERBOSE
make -j32 UiBenchJankTests UiBench  && \
tradefed.sh run template/local --template:map test=UiBenchJankTests \
      --test-tag testname --log-level-display VERBOSE

Change-Id: I63f23e3a21ad1343607953958fb7bb0a5fb8c343
2017-03-21 00:05:14 -07:00
Daichi Hirono
72de7a99b3 Fix an argument passing to putStorageDocuments.
Previously device.eventSupported was wrongly passed to
putStorageDocuments while we need to pass device.operationSupported.

Bug: 35855598
Test: manually copied a file from phone to phone
Change-Id: Iaa5d8973b3af0a157ed3196fb83971aeb148d203
2017-03-21 09:55:07 +09:00
Simran Basi
473a16e492 frameworks/base: Add APCT tests to the device-tests suite.
This CL adds the APCT tests within this project to
a similar suite as CTS known as device-tests.

The current method of running APCT tests in the infrastructure
is unaffected.

Bug: 35882476
Test: `make dist device-tests -j` and local builds of
      continuous_instrumentation_tests & continuous_native_tests

Change-Id: Ifa382fe691842c1cd76897775b9e2a1653449eb5
2017-03-15 14:46:27 -07:00
Garfield Tan
b690b4de06 Address comments from API council.
Test: Code builds and tests pass. Also some manual tests around ESP.
Bug: 35813037
Bug: 35812990
Change-Id: Ia9d3a3964e9a83d0c1c08e5db4c2e231504aa99a
2017-03-02 12:48:13 -08:00
Garfield Tan
5d3b37b947 Remove DocumentsContract.ACTION_BROWSE.
Test: It builds.
Bug: 35760993
Change-Id: Icdd125d6e6329f703c4682b47b5b9fb80d7e1f27
2017-03-01 12:11:30 -08:00
Bill Yi
ec5916d9de Import translations. DO NOT MERGE
Change-Id: Ia9de3c96be0035fbe45cabec9300b19acde07e80
Auto-generated-cl: translation import
2017-02-16 20:06:15 -08:00
TreeHugger Robot
58f34b828d Merge "Start MtpDocumentsService as foreground service." 2017-02-02 00:13:34 +00:00
Daichi Hirono
d3c6dd1522 Start MtpDocumentsService as foreground service.
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
2017-02-02 00:13:08 +00:00
Bill Yi
b3f5822ac7 Import translations. DO NOT MERGE
Change-Id: I8898f88d0454aa0065faa8e0cbc737a5dc2cc055
Auto-generated-cl: translation import
2017-01-30 19:41:51 -08:00
Paul Duffin
648abd31e8 Merge "Prepare for removal of legacy-test from default targets" 2017-01-19 09:34:19 +00:00
Daichi Hirono
e80ea38489 Use public version of AppFuse in MtpDocumentsProvider.
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
2017-01-19 14:14:00 +09:00
Paul Duffin
8aeb59ebcd Prepare for removal of legacy-test from default targets
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
2017-01-18 16:39:34 +00:00
TreeHugger Robot
07323a9824 Merge "Add structured sort data to ContentResolver.query." 2017-01-12 22:21:53 +00:00
Steve McKay
29c3f68cfa Add structured sort data to ContentResolver.query.
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.
2017-01-11 15:01:50 -08:00
Roozbeh Pournader
b84a505b62 Rename language+country resources to just language
Bug: 26496609
Test: none
Change-Id: I40b99a8728f1f324f4c1f8066a61c3d5f92b1ac6
2017-01-10 23:51:26 -08:00
Bill Yi
996f5c95a0 Import translations. DO NOT MERGE
Change-Id: I336be133ac6cfae27371dabc43273ffdf34073bf
Auto-generated-cl: translation import
2016-12-06 03:09:21 -08:00
Bill Yi
a0973d0366 Revert "Import translations. DO NOT MERGE"
This reverts commit 27b4c8cc859b92046bb61b7abbd216d9be8a2762.

Change-Id: I01eb5253157cf526ea6bd145d1f6eee0ae073b35
2016-12-05 18:58:59 +00:00
Bill Yi
27b4c8cc85 Import translations. DO NOT MERGE
Change-Id: I64212a807cb6316ba7d5df5d1472a8fab0552dd8
Auto-generated-cl: translation import
2016-12-02 20:55:33 -08:00
Daichi Hirono
29de7693f4 Add isChildDocument to MtpDocumentsProvider.
Bug: 32687127
Test: adb shell am instrument -w -e class com.android.mtp.MtpDocumentsProviderTest#testIsChildDocument com.android.mtp.tests/com.android.mtp.TestResultInstrumentation
Change-Id: I44ded3c73443735229a8b3465122f7e10c4da178
2016-11-08 09:09:18 +09:00
TreeHugger Robot
2cf7c483a8 Merge "Not create document under the device." 2016-11-07 06:21:48 +00:00
Daichi Hirono
35b2ec551f Not create document under the device.
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
2016-11-07 10:29:09 +09:00
Garfield Tan
f46a463e41 Change findPath() to findDocumentPath() in MtpDocumentsProvider.
Test: It builds.
Change-Id: If474e766b5680d49a7557f0e7ee1c039eb4efae0
2016-11-02 16:18:33 -07:00
Daichi Hirono
b9ffa2a1d2 Add findPath method to MtpDocumentsProvider.
Bug: 32515515
Test: adb shell am instrument -w -e class com.android.mtp.MtpDocumentsProviderTest com.android.mtp.tests/com.android.mtp.TestResultInstrumentation
Change-Id: Ib87e8f5258de8fd48a099adbf077b3b9ff85773c
2016-11-02 12:33:45 +09:00
Steve McKay
e5a8a17ed2 Remove the EXTRA_FANCY_FEATURES flag...
Which is no-longer necessary.

Test: build and run.

Change-Id: I515c4a1bf78cbf4d54304bf4ebe1059a596c95a0
2016-10-28 16:55:27 -07:00
Mark Salyzyn
21c2e9e60c Merge "missing includes" am: 78929f3ee0 am: 6a8f0d70b0
am: 6e60ab12e7

Change-Id: I1b5c6f49d2ae565ebd59c6ce8d590512ab306487
2016-10-17 21:38:33 +00:00
Mark Salyzyn
6a8f0d70b0 Merge "missing includes"
am: 78929f3ee0

Change-Id: I3e7a25ded484d516fab453abe434c2e53cf0f27e
2016-10-17 21:25:59 +00:00
Mark Salyzyn
4d6c372eae missing includes
Assumptions are made about header side effects

Test: compile
Bug: 30465923
Change-Id: Icc9415aed5e54b2bc00b70aa0da6df4148f30654
2016-10-17 12:32:54 -07:00
Daichi Hirono
4dd323b2d3 Rename AppFuseTest in perf test package to AppFusePerfTest.
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
2016-10-12 16:09:10 +09:00
Daichi Hirono
bdee9a9ae3 Add read/write performance test for AppFuse.
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
2016-10-07 12:28:54 +09:00
Bill Yi
7c70713140 Import translations. DO NOT MERGE
Change-Id: Ide9c72117c22c23ba4d8e3faffcc06ff3a777705
Auto-generated-cl: translation import
2016-09-21 21:32:09 -07:00
Daichi Hirono
e88dbc9dc8 Set Root.FLAG_LOCAL_ONLY for MTP roots. am: b7573e93cd
am: d590e3354d

Change-Id: I68df97198ecbd7e7bdbcdb9e678f80266b5eb887
2016-08-23 17:20:43 +00:00
Daichi Hirono
b7573e93cd Set Root.FLAG_LOCAL_ONLY for MTP roots.
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)
2016-08-22 01:24:53 +00:00
Daichi Hirono
83c679e722 Set Root.FLAG_LOCAL_ONLY for MTP roots.
The flag indicate whether the root needs network access or not. MTP
should be LOCAL_ONLY root.

Bug: 30867267

Change-Id: Ia272d4a389cc1ca628d7b963caa37f3dbb6747e3
2016-08-18 16:55:02 +00:00
Daichi Hirono
daa61d45da Fix MtpDatabaseTest#testFormatCodeForMpeg.
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
2016-08-10 14:59:18 +09:00
Bill Yi
6e231e5d17 Import translations. DO NOT MERGE
Change-Id: Ibefe0963160a02bc49c36a2511d5c3f72f8078c2
Auto-generated-cl: translation import
2016-07-20 15:23:45 -07:00
Daichi Hirono
28e6112e2f Fix NullPointerException in MtpManager.
BUG=30152892

Change-Id: I1f4ec361f499510e3ac1635ca5d134b47b6059c3
2016-07-19 15:48:04 +09:00
Bill Yi
2a824d635a Import translations. DO NOT MERGE
Change-Id: Iecbfb973538722055462e89e730f73c562a649bd
Auto-generated-cl: translation import
2016-07-05 12:58:36 -07:00
Bill Yi
0789113f7f Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 29390361
Change-Id: Ie154b48d77d2bc34ae1e71e1c3813c3ed2959eeb
2016-06-30 18:41:48 -07:00
Bill Yi
f544a4bdcd Import translations. DO NOT MERGE
Change-Id: I9936b6b782ee33e1748960f86eeb765f41024e86
Auto-generated-cl: translation import
2016-06-29 12:36:34 -07:00
Bill Yi
18c27ae9b7 Import translations. DO NOT MERGE
Change-Id: I2dca8e72d9b0325c9127ccfa40432e918334f096
Auto-generated-cl: translation import
2016-06-27 01:29:47 -07:00
Bill Yi
b137b24ccb Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 29578243
Change-Id: Ibccd468924a986297bb779eef68d4b2ed392b73f
2016-06-24 08:38:58 -07:00
Bill Yi
25fb5dc045 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 29578243
Change-Id: Ib2f11b1824415b6ccbc26e0cd6fbae8dfcea6058
2016-06-24 08:31:09 -07:00
Daichi Hirono
f20e49ecb9 Fix warning from error prone.
BUG=29146585

Change-Id: Ic54caecf1abd74affcd902a9561adcdaa8f10c59
2016-06-08 16:21:06 +09:00
Daichi Hirono
86c1a9bf60 Remove MTP API marked as @removed.
BUG=28146379

Change-Id: I4f0a380941663eac423f8a5633447f1eceb516cb
2016-05-26 16:39:21 +09:00
Steve McKay
935d7d6854 Merge "Don\'t show new-window item in Downloads per Gabe." into nyc-dev am: fec0d188c1 am: 6fdaf2f2cf
am: b8995b7abc

* commit 'b8995b7abc9cbaa1dcb363c68535a63f4e8768a3':
  Don't show new-window item in Downloads per Gabe.

Change-Id: I54d288582f474ed1a0718a3f6327af7f1814be75
2016-05-13 17:42:44 +00:00
Chih-hung Hsieh
51bec5a191 Merge "Fix google-explicit-constructor warnings." 2016-05-12 16:36:34 +00:00