blob: 472d8e502f73bd4327dcdfbd372e5c58f073b554 [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
24#include <binder/IInterface.h>
25#include <binder/Parcel.h>
26
27namespace android {
28
29class IMountService: public IInterface {
30public:
31 DECLARE_META_INTERFACE(MountService);
32
33 virtual void registerListener(const sp<IMountServiceListener>& listener) = 0;
34 virtual void
35 unregisterListener(const sp<IMountServiceListener>& listener) = 0;
36 virtual bool isUsbMassStorageConnected() = 0;
37 virtual void setUsbMassStorageEnabled(const bool enable) = 0;
38 virtual bool isUsbMassStorageEnabled() = 0;
39 virtual int32_t mountVolume(const String16& mountPoint) = 0;
40 virtual int32_t
41 unmountVolume(const String16& mountPoint, const bool force) = 0;
42 virtual int32_t formatVolume(const String16& mountPoint) = 0;
43 virtual int32_t
44 getStorageUsers(const String16& mountPoint, int32_t** users) = 0;
45 virtual int32_t getVolumeState(const String16& mountPoint) = 0;
46 virtual int32_t createSecureContainer(const String16& id,
47 const int32_t sizeMb, const String16& fstype, const String16& key,
48 const int32_t ownerUid) = 0;
49 virtual int32_t finalizeSecureContainer(const String16& id) = 0;
50 virtual int32_t destroySecureContainer(const String16& id) = 0;
51 virtual int32_t mountSecureContainer(const String16& id,
52 const String16& key, const int32_t ownerUid) = 0;
53 virtual int32_t
54 unmountSecureContainer(const String16& id, const bool force) = 0;
55 virtual bool isSecureContainerMounted(const String16& id) = 0;
56 virtual int32_t renameSecureContainer(const String16& oldId,
57 const String16& newId) = 0;
58 virtual bool getSecureContainerPath(const String16& id, String16& path) = 0;
59 virtual int32_t getSecureContainerList(const String16& id,
60 String16*& containers) = 0;
61 virtual void shutdown(const sp<IMountShutdownObserver>& observer) = 0;
62 virtual void finishMediaUpdate() = 0;
63 virtual void mountObb(const String16& filename, const String16& key,
Kenny Rootaf9d6672010-10-08 09:21:39 -070064 const sp<IObbActionListener>& token, const int32_t nonce) = 0;
Kenny Root05105f72010-09-22 17:29:43 -070065 virtual void unmountObb(const String16& filename, const bool force,
Kenny Rootaf9d6672010-10-08 09:21:39 -070066 const sp<IObbActionListener>& token, const int32_t nonce) = 0;
Kenny Rootbe857d42010-08-18 15:59:25 -070067 virtual bool isObbMounted(const String16& filename) = 0;
68 virtual bool getMountedObbPath(const String16& filename, String16& path) = 0;
Jason parks5af0b912010-11-29 09:05:25 -060069 virtual int32_t decryptStorage(const String16& password) = 0;
Jason parks56aa5322011-01-07 09:01:15 -060070 virtual int32_t encryptStorage(const String16& password) = 0;
Kenny Rootbe857d42010-08-18 15:59:25 -070071};
72
73// ----------------------------------------------------------------------------
74
75class BnMountService: public BnInterface<IMountService> {
76public:
77 virtual status_t onTransact(uint32_t code, const Parcel& data,
78 Parcel* reply, uint32_t flags = 0);
79};
80
81}
82; // namespace android
83
84#endif // ANDROID_IMOUNTSERVICE_H