blob: 538cae909b6fb389b1dfee9f49daee2d77a00297 [file] [log] [blame]
Risan8c9f3322018-10-29 08:52:56 +09001/*
2 * Copyright (C) 2018 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_VOLD_STUB_VOLUME_H
18#define ANDROID_VOLD_STUB_VOLUME_H
19
20#include "VolumeBase.h"
21
22namespace android {
23namespace vold {
24
25/*
26 * A vold representation of volumes managed from outside Android (e.g., ARC++).
27 *
28 * Used for the case when events such that mounting and unmounting are
29 * actually handled from outside vold, and vold only need to keep track on those
30 * vents instead of talking to kernel directly.
31 */
32class StubVolume : public VolumeBase {
33 public:
34 StubVolume(int id, const std::string& sourcePath, const std::string& mountPath,
35 const std::string& fsType, const std::string& fsUuid, const std::string& fsLabel);
36 virtual ~StubVolume();
37
38 protected:
39 status_t doCreate() override;
40 status_t doDestroy() override;
41 status_t doMount() override;
42 status_t doUnmount() override;
43 status_t doFormat(const std::string& fsType) override;
44
45 private:
46 const std::string mSourcePath;
47 const std::string mMountPath;
48 const std::string mFsType;
49 const std::string mFsUuid;
50 const std::string mFsLabel;
51
52 DISALLOW_COPY_AND_ASSIGN(StubVolume);
53};
54
55} // namespace vold
56} // namespace android
57
58#endif