blob: 4c8a74200ee0623a191f14a7cf5fc7f8dbd0e7db [file] [log] [blame]
Daichi Hirono0b494662015-09-10 20:38:15 +09001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.mtp;
18
19/**
20 * This class encapsulates information about a MTP event.
Daichi Hirono85f70782015-10-07 08:12:33 -070021 * Event constants are defined by the USB-IF MTP specification.
Daichi Hirono0b494662015-09-10 20:38:15 +090022 */
23public class MtpEvent {
Daichi Hirono85f70782015-10-07 08:12:33 -070024 public static final int EVENT_UNDEFINED = 0x4000;
25 public static final int EVENT_CANCEL_TRANSACTION = 0x4001;
26 public static final int EVENT_OBJECT_ADDED = 0x4002;
27 public static final int EVENT_OBJECT_REMOVED = 0x4003;
28 public static final int EVENT_STORE_ADDED = 0x4004;
29 public static final int EVENT_STORE_REMOVED = 0x4005;
30 public static final int EVENT_DEVICE_PROP_CHANGED = 0x4006;
31 public static final int EVENT_OBJECT_INFO_CHANGED = 0x4007;
32 public static final int EVENT_DEVICE_INFO_CHANGED = 0x4008;
33 public static final int EVENT_REQUEST_OBJECT_TRANSFER = 0x4009;
34 public static final int EVENT_STORE_FULL = 0x400A;
35 public static final int EVENT_DEVICE_RESET = 0x400B;
36 public static final int EVENT_STORAGE_INFO_CHANGED = 0x400C;
37 public static final int EVENT_CAPTURE_COMPLETE = 0x400D;
38 public static final int EVENT_UNREPORTED_STATUS = 0x400E;
39 public static final int EVENT_OBJECT_PROP_CHANGED = 0xC801;
40 public static final int EVENT_OBJECT_PROP_DESC_CHANGED = 0xC802;
41 public static final int EVENT_OBJECT_REFERENCES_CHANGED = 0xC803;
42
43 private int mEventCode = EVENT_UNDEFINED;
Daichi Hirono0b494662015-09-10 20:38:15 +090044
45 /**
46 * Returns event code of MTP event.
Daichi Hirono85f70782015-10-07 08:12:33 -070047 * See the USB-IF MTP specification for the details of event constants.
Daichi Hirono0b494662015-09-10 20:38:15 +090048 * @return event code
49 */
50 public int getEventCode() { return mEventCode; }
51}