1/*
2 * Copyright (C) 2007 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//
18#ifndef ANDROID_HARDWARE_IMOUNTSERVICE_H
19#define ANDROID_HARDWARE_IMOUNTSERVICE_H
20
21#include <binder/IInterface.h>
22#include <utils/String16.h>
23
24namespace android {
25
26// ----------------------------------------------------------------------
27
28class IMountService : public IInterface
29{
30public:
31    static const int OperationSucceeded               = 0;
32    static const int OperationFailedInternalError     = -1;
33    static const int OperationFailedNoMedia           = -2;
34    static const int OperationFailedMediaBlank        = -3;
35    static const int OperationFailedMediaCorrupt      = -4;
36    static const int OperationFailedVolumeNotMounted  = -5;
37
38
39public:
40    DECLARE_META_INTERFACE(MountService);
41
42    virtual void getShareMethodList() = 0;
43    virtual bool getShareMethodAvailable(String16 method) = 0;
44    virtual int shareVolume(String16 path, String16 method) = 0;
45    virtual int unshareVolume(String16 path, String16 method) = 0;
46    virtual bool getVolumeShared(String16 path, String16 method) = 0;
47    virtual int mountVolume(String16 path) = 0;
48    virtual int unmountVolume(String16 path) = 0;
49    virtual int formatVolume(String16 path) = 0;
50    virtual String16 getVolumeState(String16 mountPoint) = 0;
51    virtual int createSecureContainer(String16 id, int sizeMb, String16 fstype, String16 key, int ownerUid) = 0;
52    virtual int finalizeSecureContainer(String16 id) = 0;
53    virtual int destroySecureContainer(String16 id) = 0;
54    virtual int mountSecureContainer(String16 id, String16 key, int ownerUid) = 0;
55    virtual int unmountSecureContainer(String16 id) = 0;
56    virtual int renameSecureContainer(String16 oldId, String16 newId) = 0;
57    virtual String16 getSecureContainerPath(String16 id) = 0;
58    virtual void getSecureContainerList() = 0;
59    virtual void shutdown() = 0;
60};
61
62// ----------------------------------------------------------------------
63
64}; // namespace android
65
66#endif // ANDROID_HARDWARE_IMOUNTSERVICE_H
67