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

Commit 1474c7a2 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

PTP: Add android.provider.Ptp to the public API



This will allow 3rd party apps to access files on digital cameras via the PTP protocol

BUG: 3210830

Change-Id: I06dbf2842a7eea2e0749e2124bb7b7a65e8901c0
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 23f15380
Loading
Loading
Loading
Loading
+462 −0
Original line number Diff line number Diff line
@@ -161134,6 +161134,468 @@
>
</field>
</interface>
<class name="Ptp"
 extends="java.lang.Object"
 abstract="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="Ptp"
 type="android.provider.Ptp"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<field name="AUTHORITY"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;ptp&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="Ptp.Device"
 extends="java.lang.Object"
 abstract="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<implements name="android.provider.BaseColumns">
</implements>
<constructor name="Ptp.Device"
 type="android.provider.Ptp.Device"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="getContentUri"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="deviceID" type="int">
</parameter>
</method>
<field name="CONTENT_URI"
 type="android.net.Uri"
 transient="false"
 volatile="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MANUFACTURER"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;manufacturer&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MODEL"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;model&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="Ptp.Object"
 extends="java.lang.Object"
 abstract="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<implements name="android.provider.BaseColumns">
</implements>
<constructor name="Ptp.Object"
 type="android.provider.Ptp.Object"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="getContentUri"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="deviceID" type="int">
</parameter>
<parameter name="objectID" type="long">
</parameter>
</method>
<method name="getContentUriForImport"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="deviceID" type="int">
</parameter>
<parameter name="objectID" type="long">
</parameter>
<parameter name="destPath" type="java.lang.String">
</parameter>
</method>
<method name="getContentUriForObjectChildren"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="deviceID" type="int">
</parameter>
<parameter name="objectID" type="long">
</parameter>
</method>
<method name="getContentUriForStorageChildren"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="deviceID" type="int">
</parameter>
<parameter name="storageID" type="long">
</parameter>
</method>
<field name="ASSOCIATION_DESC"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;association_desc&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="ASSOCIATION_TYPE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;association_type&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="DATE_CREATED"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;date_created&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="DATE_MODIFIED"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;date_modified&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FORMAT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;format&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="IMAGE_DEPTH"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;image_depth&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="IMAGE_HEIGHT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;image_height&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="IMAGE_WIDTH"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;image_width&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="KEYWORDS"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;keywords&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="NAME"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;name&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="PARENT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;parent&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="PROTECTION_STATUS"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;protection_status&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SEQUENCE_NUMBER"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;sequence_number&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SIZE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;size&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="STORAGE_ID"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;storage_id&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="THUMB"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;thumb&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="THUMB_FORMAT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;thumb_format&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="THUMB_HEIGHT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;thumb_height&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="THUMB_SIZE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;thumb_size&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="THUMB_WIDTH"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;thumb_width&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="Ptp.Storage"
 extends="java.lang.Object"
 abstract="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<implements name="android.provider.BaseColumns">
</implements>
<constructor name="Ptp.Storage"
 type="android.provider.Ptp.Storage"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="getContentUri"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="deviceID" type="int">
</parameter>
</method>
<method name="getContentUri"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="deviceID" type="int">
</parameter>
<parameter name="storageID" type="long">
</parameter>
</method>
<field name="DESCRIPTION"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;description&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="IDENTIFIER"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;identifier&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="SearchRecentSuggestions"
 extends="java.lang.Object"
 abstract="false"
+18 −10
Original line number Diff line number Diff line
@@ -20,10 +20,13 @@ import android.content.ContentUris;
import android.net.Uri;
import android.util.Log;


/**
 * The PTP provider supports accessing content on PTP devices.
 * @hide
 * Currently the provider supports:
 * - enumerating the storage units, files and directories on PTP devices
 * - deleting files and directories on PTP devices
 * - importing a file from PTP device into the host device's storage
 *   and adding it to the media provider
 */
public final class Ptp
{
@@ -36,6 +39,8 @@ public final class Ptp

    /**
     * Contains list of all PTP devices
     * The BaseColumns._ID column contains a hardware specific identifier for the attached
     * USB device, and is not guaranteed to be persistent across USB disconnects.
     */
    public static final class Device implements BaseColumns {

@@ -59,7 +64,8 @@ public final class Ptp
    }

    /**
     * Contains list of storage units for an PTP device
     * Contains list of storage units for an PTP device.
     * The BaseColumns._ID column contains the PTP StorageID for the storage unit.
     */
    public static final class Storage implements BaseColumns {

@@ -85,7 +91,10 @@ public final class Ptp
    }

    /**
     * Contains list of objects on an PTP device
     * Contains list of objects on a PTP device.
     * The columns in this table correspond directly to the ObjectInfo dataset
     * described in the PTP specification (PIMA 15740:2000).
     * The BaseColumns._ID column contains the object's PTP ObjectHandle.
     */
    public static final class Object implements BaseColumns {

@@ -135,14 +144,14 @@ public final class Ptp
        public static final String STORAGE_ID = "storage_id";

        /**
         * The object's format.  Can be one of the FORMAT_* symbols below,
         * or any of the valid PTP object formats as defined in the PTP specification.
         * The object's format.  Can be any of the valid PTP object formats
         * as defined in the PTP specification.
         * <P>Type: INTEGER</P>
         */
        public static final String FORMAT = "format";

        /**
         * The protection status of the object.  See the PROTECTION_STATUS_*symbols below.
         * The protection status of the object.
         * <P>Type: INTEGER</P>
         */
        public static final String PROTECTION_STATUS = "protection_status";
@@ -154,8 +163,8 @@ public final class Ptp
        public static final String SIZE = "size";

        /**
         * The object's thumbnail format.  Can be one of the FORMAT_* symbols below,
         * or any of the valid PTP object formats as defined in the PTP specification.
         * The object's thumbnail format.  Can be any of the valid PTP object formats
         * as defined in the PTP specification.
         * <P>Type: INTEGER</P>
         */
        public static final String THUMB_FORMAT = "thumb_format";
@@ -211,7 +220,6 @@ public final class Ptp

        /**
         * The association type for a container object.
         * For folders this is typically {@link #ASSOCIATION_TYPE_GENERIC_FOLDER}
         * <P>Type: INTEGER</P>
         */
        public static final String ASSOCIATION_TYPE = "association_type";