1 /**
2  * Copyright (c) 2016, 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 import android.os.storage.DiskInfo;
20 import android.os.storage.VolumeInfo;
21 import android.os.storage.VolumeRecord;
22 
23 /**
24  * Callback class for receiving events from StorageManagerService.
25  *
26  * Don't change the existing transaction Ids as they could be used in the native code.
27  * When adding a new method, assign the next available transaction id.
28  *
29  * @hide - Applications should use {@link android.os.storage.StorageEventListener} class for
30  *         storage event callbacks.
31  */
32 oneway interface IStorageEventListener {
33     /**
34      * Detection state of USB Mass Storage has changed
35      *
36      * @param available true if a UMS host is connected.
37      */
onUsbMassStorageConnectionChanged(boolean connected)38     void onUsbMassStorageConnectionChanged(boolean connected) = 0;
39 
40     /**
41      * Storage state has changed.
42      *
43      * @param path The volume mount path.
44      * @param oldState The old state of the volume.
45      * @param newState The new state of the volume. Note: State is one of the
46      *            values returned by Environment.getExternalStorageState()
47      */
onStorageStateChanged(in String path, in String oldState, in String newState)48     void onStorageStateChanged(in String path, in String oldState, in String newState) = 1;
49 
onVolumeStateChanged(in VolumeInfo vol, int oldState, int newState)50     void onVolumeStateChanged(in VolumeInfo vol, int oldState, int newState) = 2;
51 
52     void onVolumeRecordChanged(in VolumeRecord rec) = 3;
53 
54     void onVolumeForgotten(in String fsUuid) = 4;
55 
onDiskScanned(in DiskInfo disk, int volumeCount)56     void onDiskScanned(in DiskInfo disk, int volumeCount) = 5;
57 
58     void onDiskDestroyed(in DiskInfo disk) = 6;
59 
60     /**
61      * Don't change the existing transaction Ids as they could be used in the native code.
62      * When adding a new method, assign the next available transaction id.
63      */
64 }