250 Commits

Author SHA1 Message Date
Anton Hansson
a3e79fbb8c frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: Ibcffec873a693d1c792ca210fb597d2bf37e9068
Merged-In: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 17:15:21 +00:00
Bill Yi
2598a133ef Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 69925163
Change-Id: Ided857799b25fe123782edb65ef2b54f1244af5d
2017-11-29 22:42:06 -08:00
Bill Yi
5509dc4083 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import

Bug: 68003463
Change-Id: I4b0f45fb1d4416ac0996365e9da9f83b966c6e66
2017-10-19 20:59:22 -07:00
Daichi Hirono
c5949bd39c Fix NPE in MtpDocumentsProviderTests
Previous patch ag/2250238 broke MtpDocumentsProviderTests since
ServiceIntentSender's constructor refers the context argument which is
null in the tests.

The CL adds a test version of the constructor which does not use the
context argument in it.

Bug: 38363487
Test: MtpDocumentsProviderTests
Change-Id: I68a1d8cb6997499e5069c33f70fd0f675aaad77c
2017-05-18 12:54:25 +09:00
TreeHugger Robot
8b81a0a1fc Merge "Set notification channel to MTP notification." into oc-dev 2017-05-17 03:13:27 +00:00
Daichi Hirono
3393bc9a7c Set notification channel to MTP notification.
Bug: 38252594
Test: Manually connect MTP device to Android
Change-Id: Ib7ab12b2401d36dbb4cca2fd9c18cbd3505ed9ef
2017-05-17 10:36:06 +09:00
Jeff Sharkey
5f0460e60e Merge "Don't specify screen orientation for ReceiverActivity." into oc-dev 2017-05-16 22:42:10 +00:00
Daichi Hirono
0da3b1a174 Don't specify screen orientation for ReceiverActivity.
From O, the framework does not allow to specify screen orientation for
translucent acitivity.

Bug: 38225950
Test: manually connect MTP device to Android
Change-Id: I83c5063f6b85aff3c05906b9d66efbcde9693224
2017-05-12 16:39:40 +09:00
Daichi Hirono
0f6ab57eef Fix doc flag for device having multiple storages
Previously MtpDocumentsProvider#queryDocument returned
FLAG_DIR_SUPPORTS_CREATE for device having multiple storages.

This was wrong because if the device has multiple storages,
MtpDocumentsProvider places the storages under the device document, thus
users cannot create a document just under the device document.

Bug: 35700994
Test: MtpDocumentsProviderTests
Change-Id: Id73a34a2eaf4e10e23be3c2da7488036cea10000
(cherry picked from commit 66fcb4beae9605cd034c9437e510b21260d6f519)
2017-05-01 19:45:51 +00:00
Daichi Hirono
98f48479e9 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
(cherry picked from commit 203be491ef479deea1f39f8b63f3e1916501a37a)
2017-04-07 05:12:37 +00: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