summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Daichi Hirono <hirono@google.com> 2015-10-07 08:12:33 -0700
committer Daichi Hirono <hirono@google.com> 2015-10-13 12:49:16 -0700
commit85f7078f8bfde3d00494bbb09e78179e3239c9a5 (patch)
treedf1038ecfd3546229cad7ea96967a5a7062b6a99
parent992b331d2a31830ac5c7842abd29bd54d988c5da (diff)
Add constans for MTP event codes.
BUG=23368533 Change-Id: I922eb9a26812a44780ba81b8a391be45852cad08
-rw-r--r--api/current.txt18
-rw-r--r--api/system-current.txt18
-rw-r--r--media/java/android/mtp/MtpEvent.java24
3 files changed, 58 insertions, 2 deletions
diff --git a/api/current.txt b/api/current.txt
index ef18bf9f05f6..301878df5282 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -18173,6 +18173,24 @@ package android.mtp {
public class MtpEvent {
ctor public MtpEvent();
method public int getEventCode();
+ 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 {
diff --git a/api/system-current.txt b/api/system-current.txt
index 0b216bdddb30..abafb359b216 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -19685,6 +19685,24 @@ package android.mtp {
public class MtpEvent {
ctor public MtpEvent();
method public int getEventCode();
+ 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 {
diff --git a/media/java/android/mtp/MtpEvent.java b/media/java/android/mtp/MtpEvent.java
index 0fa7d93e12ca..4c8a74200ee0 100644
--- a/media/java/android/mtp/MtpEvent.java
+++ b/media/java/android/mtp/MtpEvent.java
@@ -18,13 +18,33 @@ package android.mtp;
/**
* This class encapsulates information about a MTP event.
+ * Event constants are defined by the USB-IF MTP specification.
*/
public class MtpEvent {
- private int mEventCode;
+ public static final int EVENT_UNDEFINED = 0x4000;
+ public static final int EVENT_CANCEL_TRANSACTION = 0x4001;
+ public static final int EVENT_OBJECT_ADDED = 0x4002;
+ public static final int EVENT_OBJECT_REMOVED = 0x4003;
+ public static final int EVENT_STORE_ADDED = 0x4004;
+ public static final int EVENT_STORE_REMOVED = 0x4005;
+ public static final int EVENT_DEVICE_PROP_CHANGED = 0x4006;
+ public static final int EVENT_OBJECT_INFO_CHANGED = 0x4007;
+ public static final int EVENT_DEVICE_INFO_CHANGED = 0x4008;
+ public static final int EVENT_REQUEST_OBJECT_TRANSFER = 0x4009;
+ public static final int EVENT_STORE_FULL = 0x400A;
+ public static final int EVENT_DEVICE_RESET = 0x400B;
+ public static final int EVENT_STORAGE_INFO_CHANGED = 0x400C;
+ public static final int EVENT_CAPTURE_COMPLETE = 0x400D;
+ public static final int EVENT_UNREPORTED_STATUS = 0x400E;
+ public static final int EVENT_OBJECT_PROP_CHANGED = 0xC801;
+ public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 0xC802;
+ public static final int EVENT_OBJECT_REFERENCES_CHANGED = 0xC803;
+
+ private int mEventCode = EVENT_UNDEFINED;
/**
* Returns event code of MTP event.
- *
+ * See the USB-IF MTP specification for the details of event constants.
* @return event code
*/
public int getEventCode() { return mEventCode; }