xref: /aosp_15_r20/hardware/libhardware_legacy/include/hardware_legacy/IMountService.h (revision 79330504eb3d14022296e3b041867f86289dd52c)
1*79330504STreehugger Robot /*
2*79330504STreehugger Robot  * Copyright (C) 2007 The Android Open Source Project
3*79330504STreehugger Robot  *
4*79330504STreehugger Robot  * Licensed under the Apache License, Version 2.0 (the "License");
5*79330504STreehugger Robot  * you may not use this file except in compliance with the License.
6*79330504STreehugger Robot  * You may obtain a copy of the License at
7*79330504STreehugger Robot  *
8*79330504STreehugger Robot  *      http://www.apache.org/licenses/LICENSE-2.0
9*79330504STreehugger Robot  *
10*79330504STreehugger Robot  * Unless required by applicable law or agreed to in writing, software
11*79330504STreehugger Robot  * distributed under the License is distributed on an "AS IS" BASIS,
12*79330504STreehugger Robot  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*79330504STreehugger Robot  * See the License for the specific language governing permissions and
14*79330504STreehugger Robot  * limitations under the License.
15*79330504STreehugger Robot  */
16*79330504STreehugger Robot 
17*79330504STreehugger Robot //
18*79330504STreehugger Robot #ifndef ANDROID_HARDWARE_IMOUNTSERVICE_H
19*79330504STreehugger Robot #define ANDROID_HARDWARE_IMOUNTSERVICE_H
20*79330504STreehugger Robot 
21*79330504STreehugger Robot #include <binder/IInterface.h>
22*79330504STreehugger Robot #include <utils/String16.h>
23*79330504STreehugger Robot 
24*79330504STreehugger Robot namespace android {
25*79330504STreehugger Robot 
26*79330504STreehugger Robot // ----------------------------------------------------------------------
27*79330504STreehugger Robot 
28*79330504STreehugger Robot class IMountService : public IInterface
29*79330504STreehugger Robot {
30*79330504STreehugger Robot public:
31*79330504STreehugger Robot     static const int OperationSucceeded               = 0;
32*79330504STreehugger Robot     static const int OperationFailedInternalError     = -1;
33*79330504STreehugger Robot     static const int OperationFailedNoMedia           = -2;
34*79330504STreehugger Robot     static const int OperationFailedMediaBlank        = -3;
35*79330504STreehugger Robot     static const int OperationFailedMediaCorrupt      = -4;
36*79330504STreehugger Robot     static const int OperationFailedVolumeNotMounted  = -5;
37*79330504STreehugger Robot 
38*79330504STreehugger Robot 
39*79330504STreehugger Robot public:
40*79330504STreehugger Robot     DECLARE_META_INTERFACE(MountService);
41*79330504STreehugger Robot 
42*79330504STreehugger Robot     virtual void getShareMethodList() = 0;
43*79330504STreehugger Robot     virtual bool getShareMethodAvailable(String16 method) = 0;
44*79330504STreehugger Robot     virtual int shareVolume(String16 path, String16 method) = 0;
45*79330504STreehugger Robot     virtual int unshareVolume(String16 path, String16 method) = 0;
46*79330504STreehugger Robot     virtual bool getVolumeShared(String16 path, String16 method) = 0;
47*79330504STreehugger Robot     virtual int mountVolume(String16 path) = 0;
48*79330504STreehugger Robot     virtual int unmountVolume(String16 path) = 0;
49*79330504STreehugger Robot     virtual int formatVolume(String16 path) = 0;
50*79330504STreehugger Robot     virtual String16 getVolumeState(String16 mountPoint) = 0;
51*79330504STreehugger Robot     virtual int createSecureContainer(String16 id, int sizeMb, String16 fstype, String16 key, int ownerUid) = 0;
52*79330504STreehugger Robot     virtual int finalizeSecureContainer(String16 id) = 0;
53*79330504STreehugger Robot     virtual int destroySecureContainer(String16 id) = 0;
54*79330504STreehugger Robot     virtual int mountSecureContainer(String16 id, String16 key, int ownerUid) = 0;
55*79330504STreehugger Robot     virtual int unmountSecureContainer(String16 id) = 0;
56*79330504STreehugger Robot     virtual int renameSecureContainer(String16 oldId, String16 newId) = 0;
57*79330504STreehugger Robot     virtual String16 getSecureContainerPath(String16 id) = 0;
58*79330504STreehugger Robot     virtual void getSecureContainerList() = 0;
59*79330504STreehugger Robot     virtual void shutdown() = 0;
60*79330504STreehugger Robot };
61*79330504STreehugger Robot 
62*79330504STreehugger Robot // ----------------------------------------------------------------------
63*79330504STreehugger Robot 
64*79330504STreehugger Robot }; // namespace android
65*79330504STreehugger Robot 
66*79330504STreehugger Robot #endif // ANDROID_HARDWARE_IMOUNTSERVICE_H
67