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

Commit 399df701 authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Handle API review comments from the council.

 * MtpEvent: Remove public constructor since properties cannot be set
   directly.
 * MtpEvent: Move event constants from MtpConstants to MtpEvent class.
 * getPartialObject64: the byte[] must have indices of Integer.MAX_VALUE
   at most. Document as such.
 * sendObjectInfo: what happens if the transfer doesn’t succeed? How is
   the app notified? If there is a reason for the failure communicated,
   how does the app find this out? Add docs.
 * Add isOperationSupported(int) and isEventSupported(int) helpers.

Change-Id: Ifd80016d2ddd3b66d5c45f6da76b6133f0c9a617
Fixes: 28146379
parent e2be9f4a
Loading
Loading
Loading
Loading
+20 −19
Original line number Diff line number Diff line
@@ -23240,24 +23240,6 @@ package android.mtp {
    ctor public MtpConstants();
    method public static boolean isAbstractObject(int);
    field public static final int ASSOCIATION_TYPE_GENERIC_FOLDER = 1; // 0x1
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
    field public static final int FORMAT_3GP_CONTAINER = 47492; // 0xb984
    field public static final int FORMAT_AAC = 47363; // 0xb903
    field public static final int FORMAT_ABSTRACT_AUDIO_ALBUM = 47619; // 0xba03
@@ -23390,10 +23372,11 @@ package android.mtp {
    method public final int[] getOperationsSupported();
    method public final java.lang.String getSerialNumber();
    method public final java.lang.String getVersion();
    method public boolean isEventSupported(int);
    method public boolean isOperationSupported(int);
  }
  public class MtpEvent {
    ctor public MtpEvent();
    method public int getDevicePropCode();
    method public int getEventCode();
    method public int getObjectFormatCode();
@@ -23404,6 +23387,24 @@ package android.mtp {
    method public int getParameter3();
    method public int getStorageId();
    method public int getTransactionId();
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
  }
  public final class MtpObjectInfo {
+25 −0
Original line number Diff line number Diff line
@@ -165,6 +165,31 @@ package android.media.tv {

}

package android.mtp {

  public final class MtpConstants {
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
  }

}

package android.net {

  public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
+20 −19
Original line number Diff line number Diff line
@@ -24976,24 +24976,6 @@ package android.mtp {
    ctor public MtpConstants();
    method public static boolean isAbstractObject(int);
    field public static final int ASSOCIATION_TYPE_GENERIC_FOLDER = 1; // 0x1
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
    field public static final int FORMAT_3GP_CONTAINER = 47492; // 0xb984
    field public static final int FORMAT_AAC = 47363; // 0xb903
    field public static final int FORMAT_ABSTRACT_AUDIO_ALBUM = 47619; // 0xba03
@@ -25126,10 +25108,11 @@ package android.mtp {
    method public final int[] getOperationsSupported();
    method public final java.lang.String getSerialNumber();
    method public final java.lang.String getVersion();
    method public boolean isEventSupported(int);
    method public boolean isOperationSupported(int);
  }
  public class MtpEvent {
    ctor public MtpEvent();
    method public int getDevicePropCode();
    method public int getEventCode();
    method public int getObjectFormatCode();
@@ -25140,6 +25123,24 @@ package android.mtp {
    method public int getParameter3();
    method public int getStorageId();
    method public int getTransactionId();
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
  }
  public final class MtpObjectInfo {
+25 −0
Original line number Diff line number Diff line
@@ -163,6 +163,31 @@ package android.media.tv {

}

package android.mtp {

  public final class MtpConstants {
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
  }

}

package android.net {

  public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
+20 −19
Original line number Diff line number Diff line
@@ -23308,24 +23308,6 @@ package android.mtp {
    ctor public MtpConstants();
    method public static boolean isAbstractObject(int);
    field public static final int ASSOCIATION_TYPE_GENERIC_FOLDER = 1; // 0x1
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
    field public static final int FORMAT_3GP_CONTAINER = 47492; // 0xb984
    field public static final int FORMAT_AAC = 47363; // 0xb903
    field public static final int FORMAT_ABSTRACT_AUDIO_ALBUM = 47619; // 0xba03
@@ -23458,10 +23440,11 @@ package android.mtp {
    method public final int[] getOperationsSupported();
    method public final java.lang.String getSerialNumber();
    method public final java.lang.String getVersion();
    method public boolean isEventSupported(int);
    method public boolean isOperationSupported(int);
  }
  public class MtpEvent {
    ctor public MtpEvent();
    method public int getDevicePropCode();
    method public int getEventCode();
    method public int getObjectFormatCode();
@@ -23472,6 +23455,24 @@ package android.mtp {
    method public int getParameter3();
    method public int getStorageId();
    method public int getTransactionId();
    field public static final int EVENT_CANCEL_TRANSACTION = 16385; // 0x4001
    field public static final int EVENT_CAPTURE_COMPLETE = 16397; // 0x400d
    field public static final int EVENT_DEVICE_INFO_CHANGED = 16392; // 0x4008
    field public static final int EVENT_DEVICE_PROP_CHANGED = 16390; // 0x4006
    field public static final int EVENT_DEVICE_RESET = 16395; // 0x400b
    field public static final int EVENT_OBJECT_ADDED = 16386; // 0x4002
    field public static final int EVENT_OBJECT_INFO_CHANGED = 16391; // 0x4007
    field public static final int EVENT_OBJECT_PROP_CHANGED = 51201; // 0xc801
    field public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 51202; // 0xc802
    field public static final int EVENT_OBJECT_REFERENCES_CHANGED = 51203; // 0xc803
    field public static final int EVENT_OBJECT_REMOVED = 16387; // 0x4003
    field public static final int EVENT_REQUEST_OBJECT_TRANSFER = 16393; // 0x4009
    field public static final int EVENT_STORAGE_INFO_CHANGED = 16396; // 0x400c
    field public static final int EVENT_STORE_ADDED = 16388; // 0x4004
    field public static final int EVENT_STORE_FULL = 16394; // 0x400a
    field public static final int EVENT_STORE_REMOVED = 16389; // 0x4005
    field public static final int EVENT_UNDEFINED = 16384; // 0x4000
    field public static final int EVENT_UNREPORTED_STATUS = 16398; // 0x400e
  }
  public final class MtpObjectInfo {
Loading