Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 880d3be3 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Migrate MTP components into new project.

Bug: 138999976
Test: manual
Change-Id: I440fc37ff7b2be48b415989eb64b528a0c89b833
parent 7c2a8686
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
android_app {
    name: "MtpDocumentsProvider",

    srcs: ["src/**/*.java"],
    platform_apis: true,
    certificate: "media",
    privileged: true,
    optimize: {
        proguard_flags_files: ["proguard.flags"],
    },
}
+0 −43
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.mtp"
          android:sharedUserId="android.media">
    <uses-feature android:name="android.hardware.usb.host" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.MANAGE_USB" />
    <application android:label="@string/app_label">
        <provider
            android:name=".MtpDocumentsProvider"
            android:authorities="com.android.mtp.documents"
            android:grantUriPermissions="true"
            android:exported="true"
            android:permission="android.permission.MANAGE_DOCUMENTS">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
        </provider>

        <service android:name=".MtpDocumentsService" />

        <activity android:name=".ReceiverActivity"
                  android:label="@string/downloads_app_label"
                  android:icon="@mipmap/ic_launcher_download"
                  android:theme="@android:style/Theme.NoDisplay"
                  android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
            </intent-filter>
            <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
                       android:resource="@xml/device_filter" />
        </activity>

        <receiver android:name=".UsbIntentReceiver" android:exported="true">
            <intent-filter>
                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
                <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
            </intent-filter>
            <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
                       android:resource="@xml/device_filter" />
        </receiver>
    </application>
</manifest>
+1 −0
Original line number Diff line number Diff line
../../../../packages/services/Mtp
+0 −13
Original line number Diff line number Diff line
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
LOCAL_PACKAGE_NAME := MtpDocumentsProviderPerfTests
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_INSTRUMENTATION_FOR := MtpDocumentsProvider
LOCAL_CERTIFICATE := media
LOCAL_COMPATIBILITY_SUITE += device-tests

include $(BUILD_PACKAGE)
+0 −13
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.mtp.perftests"
    android:sharedUserId="android.media">

    <application>
        <uses-library android:name="android.test.runner" />
    </application>

    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
        android:targetPackage="com.android.mtp"
        android:label="Performance tests for MtpDocumentsProvider." />
</manifest>
Loading