blob: c3d34d84958be3f69901c28792cacdb20c5d45e0 [file] [log] [blame]
Kenny Rootbe857d42010-08-18 15:59:25 -07001/*
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#ifndef ANDROID_IMOUNTSERVICE_H
18#define ANDROID_IMOUNTSERVICE_H
19
20#include <storage/IMountServiceListener.h>
21#include <storage/IMountShutdownObserver.h>
22#include <storage/IObbActionListener.h>
23
Jeff Sharkey4fbbda42012-09-24 18:34:07 -070024#include <utils/String8.h>
25
Kenny Rootbe857d42010-08-18 15:59:25 -070026#include <binder/IInterface.h>
27#include <binder/Parcel.h>
28
29namespace android {
30
31class IMountService: public IInterface {
32public:
33 DECLARE_META_INTERFACE(MountService);
34
35 virtual void registerListener(const sp<IMountServiceListener>& listener) = 0;
36 virtual void
37 unregisterListener(const sp<IMountServiceListener>& listener) = 0;
38 virtual bool isUsbMassStorageConnected() = 0;
39 virtual void setUsbMassStorageEnabled(const bool enable) = 0;
40 virtual bool isUsbMassStorageEnabled() = 0;
41 virtual int32_t mountVolume(const String16& mountPoint) = 0;
Ben Komalo13c71972011-09-07 16:35:56 -070042 virtual int32_t unmountVolume(
43 const String16& mountPoint, const bool force, const bool removeEncryption) = 0;
Kenny Rootbe857d42010-08-18 15:59:25 -070044 virtual int32_t formatVolume(const String16& mountPoint) = 0;
45 virtual int32_t
46 getStorageUsers(const String16& mountPoint, int32_t** users) = 0;
47 virtual int32_t getVolumeState(const String16& mountPoint) = 0;
48 virtual int32_t createSecureContainer(const String16& id,
49 const int32_t sizeMb, const String16& fstype, const String16& key,
50 const int32_t ownerUid) = 0;
51 virtual int32_t finalizeSecureContainer(const String16& id) = 0;
52 virtual int32_t destroySecureContainer(const String16& id) = 0;
53 virtual int32_t mountSecureContainer(const String16& id,
54 const String16& key, const int32_t ownerUid) = 0;
55 virtual int32_t
56 unmountSecureContainer(const String16& id, const bool force) = 0;
57 virtual bool isSecureContainerMounted(const String16& id) = 0;
58 virtual int32_t renameSecureContainer(const String16& oldId,
59 const String16& newId) = 0;
60 virtual bool getSecureContainerPath(const String16& id, String16& path) = 0;
61 virtual int32_t getSecureContainerList(const String16& id,
62 String16*& containers) = 0;
63 virtual void shutdown(const sp<IMountShutdownObserver>& observer) = 0;
64 virtual void finishMediaUpdate() = 0;
Jeff Sharkey4fbbda42012-09-24 18:34:07 -070065 virtual void mountObb(const String16& rawPath, const String16& canonicalPath,
66 const String16& key, const sp<IObbActionListener>& token,
67 const int32_t nonce) = 0;
Kenny Root05105f72010-09-22 17:29:43 -070068 virtual void unmountObb(const String16& filename, const bool force,
Kenny Rootaf9d6672010-10-08 09:21:39 -070069 const sp<IObbActionListener>& token, const int32_t nonce) = 0;
Kenny Rootbe857d42010-08-18 15:59:25 -070070 virtual bool isObbMounted(const String16& filename) = 0;
71 virtual bool getMountedObbPath(const String16& filename, String16& path) = 0;
Jason parks5af0b912010-11-29 09:05:25 -060072 virtual int32_t decryptStorage(const String16& password) = 0;
Jason parksd6332552011-01-07 09:01:15 -060073 virtual int32_t encryptStorage(const String16& password) = 0;
Kenny Rootbe857d42010-08-18 15:59:25 -070074};
75
76// ----------------------------------------------------------------------------
77
78class BnMountService: public BnInterface<IMountService> {
79public:
80 virtual status_t onTransact(uint32_t code, const Parcel& data,
81 Parcel* reply, uint32_t flags = 0);
82};
83
84}
85; // namespace android
86
87#endif // ANDROID_IMOUNTSERVICE_H