• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 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 
17 package android.os.storage;
18 
19 /**
20  * Used for receiving notifications from {@link StorageManager} about OBB file
21  * states.
22  */
23 public abstract class OnObbStateChangeListener {
24 
25     /**
26      * The OBB container is now mounted and ready for use. Returned in status
27      * messages from calls made via {@link StorageManager}
28      */
29     public static final int MOUNTED = 1;
30 
31     /**
32      * The OBB container is now unmounted and not usable. Returned in status
33      * messages from calls made via {@link StorageManager}
34      */
35     public static final int UNMOUNTED = 2;
36 
37     /**
38      * There was an internal system error encountered while trying to mount the
39      * OBB. Returned in status messages from calls made via
40      * {@link StorageManager}
41      */
42     public static final int ERROR_INTERNAL = 20;
43 
44     /**
45      * The OBB could not be mounted by the system. Returned in status messages
46      * from calls made via {@link StorageManager}
47      */
48     public static final int ERROR_COULD_NOT_MOUNT = 21;
49 
50     /**
51      * The OBB could not be unmounted. This most likely indicates that a file is
52      * in use on the OBB. Returned in status messages from calls made via
53      * {@link StorageManager}
54      */
55     public static final int ERROR_COULD_NOT_UNMOUNT = 22;
56 
57     /**
58      * A call was made to unmount the OBB when it was not mounted. Returned in
59      * status messages from calls made via {@link StorageManager}
60      */
61     public static final int ERROR_NOT_MOUNTED = 23;
62 
63     /**
64      * The OBB has already been mounted. Returned in status messages from calls
65      * made via {@link StorageManager}
66      */
67     public static final int ERROR_ALREADY_MOUNTED = 24;
68 
69     /**
70      * The current application does not have permission to use this OBB. This
71      * could be because the OBB indicates it's owned by a different package or
72      * some other error. Returned in status messages from calls made via
73      * {@link StorageManager}
74      */
75     public static final int ERROR_PERMISSION_DENIED = 25;
76 
77     /**
78      * Called when an OBB has changed states.
79      *
80      * @param path path to the OBB file the state change has happened on
81      * @param state the current state of the OBB
82      */
onObbStateChange(String path, int state)83     public void onObbStateChange(String path, int state) {
84     }
85 }
86