2017-09-06 21:47:40 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _VOLD_NATIVE_SERVICE_H_
|
|
|
|
#define _VOLD_NATIVE_SERVICE_H_
|
|
|
|
|
2017-09-11 18:32:01 +02:00
|
|
|
#include <android-base/unique_fd.h>
|
2017-09-06 21:47:40 +02:00
|
|
|
#include <binder/BinderService.h>
|
|
|
|
|
|
|
|
#include "android/os/BnVold.h"
|
|
|
|
|
|
|
|
namespace android {
|
|
|
|
namespace vold {
|
|
|
|
|
|
|
|
class VoldNativeService : public BinderService<VoldNativeService>, public os::BnVold {
|
|
|
|
public:
|
|
|
|
static status_t start();
|
|
|
|
static char const* getServiceName() { return "vold"; }
|
|
|
|
virtual status_t dump(int fd, const Vector<String16> &args) override;
|
|
|
|
|
2017-09-13 19:49:44 +02:00
|
|
|
binder::Status setListener(const android::sp<android::os::IVoldListener>& listener);
|
|
|
|
|
2017-09-16 00:50:28 +02:00
|
|
|
binder::Status monitor();
|
2017-09-06 21:47:40 +02:00
|
|
|
binder::Status reset();
|
2017-09-07 23:27:28 +02:00
|
|
|
binder::Status shutdown();
|
2017-09-11 18:32:01 +02:00
|
|
|
binder::Status mountAll();
|
2017-09-07 23:27:28 +02:00
|
|
|
|
|
|
|
binder::Status onUserAdded(int32_t userId, int32_t userSerial);
|
|
|
|
binder::Status onUserRemoved(int32_t userId);
|
|
|
|
binder::Status onUserStarted(int32_t userId);
|
|
|
|
binder::Status onUserStopped(int32_t userId);
|
|
|
|
|
|
|
|
binder::Status partition(const std::string& diskId, int32_t partitionType, int32_t ratio);
|
|
|
|
binder::Status forgetPartition(const std::string& partGuid);
|
|
|
|
|
|
|
|
binder::Status mount(const std::string& volId, int32_t mountFlags, int32_t mountUserId);
|
|
|
|
binder::Status unmount(const std::string& volId);
|
|
|
|
binder::Status format(const std::string& volId, const std::string& fsType);
|
2017-09-15 20:57:44 +02:00
|
|
|
binder::Status benchmark(const std::string& volId,
|
|
|
|
const android::sp<android::os::IVoldTaskListener>& listener);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
2017-09-15 20:57:44 +02:00
|
|
|
binder::Status moveStorage(const std::string& fromVolId, const std::string& toVolId,
|
|
|
|
const android::sp<android::os::IVoldTaskListener>& listener);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
|
|
|
binder::Status remountUid(int32_t uid, int32_t remountMode);
|
|
|
|
|
|
|
|
binder::Status mkdirs(const std::string& path);
|
2017-09-11 18:32:01 +02:00
|
|
|
|
|
|
|
binder::Status createObb(const std::string& sourcePath, const std::string& sourceKey,
|
|
|
|
int32_t ownerGid, std::string* _aidl_return);
|
|
|
|
binder::Status destroyObb(const std::string& volId);
|
|
|
|
|
2017-09-15 20:57:44 +02:00
|
|
|
binder::Status fstrim(int32_t fstrimFlags,
|
|
|
|
const android::sp<android::os::IVoldTaskListener>& listener);
|
2017-09-11 18:32:01 +02:00
|
|
|
|
|
|
|
binder::Status mountAppFuse(int32_t uid, int32_t pid, int32_t mountId,
|
|
|
|
android::base::unique_fd* _aidl_return);
|
|
|
|
binder::Status unmountAppFuse(int32_t uid, int32_t pid, int32_t mountId);
|
2017-09-13 00:30:52 +02:00
|
|
|
|
|
|
|
binder::Status fdeCheckPassword(const std::string& password);
|
|
|
|
binder::Status fdeRestart();
|
|
|
|
binder::Status fdeComplete(int32_t* _aidl_return);
|
|
|
|
binder::Status fdeEnable(int32_t passwordType,
|
|
|
|
const std::string& password, int32_t encryptionFlags);
|
|
|
|
binder::Status fdeChangePassword(int32_t passwordType,
|
|
|
|
const std::string& password);
|
|
|
|
binder::Status fdeVerifyPassword(const std::string& password);
|
|
|
|
binder::Status fdeGetField(const std::string& key, std::string* _aidl_return);
|
|
|
|
binder::Status fdeSetField(const std::string& key, const std::string& value);
|
|
|
|
binder::Status fdeGetPasswordType(int32_t* _aidl_return);
|
|
|
|
binder::Status fdeGetPassword(std::string* _aidl_return);
|
|
|
|
binder::Status fdeClearPassword();
|
|
|
|
|
|
|
|
binder::Status fbeEnable();
|
|
|
|
|
|
|
|
binder::Status mountDefaultEncrypted();
|
|
|
|
binder::Status initUser0();
|
|
|
|
binder::Status isConvertibleToFbe(bool* _aidl_return);
|
|
|
|
|
|
|
|
binder::Status createUserKey(int32_t userId, int32_t userSerial, bool ephemeral);
|
|
|
|
binder::Status destroyUserKey(int32_t userId);
|
|
|
|
|
|
|
|
binder::Status addUserKeyAuth(int32_t userId, int32_t userSerial,
|
|
|
|
const std::string& token, const std::string& secret);
|
|
|
|
binder::Status fixateNewestUserKeyAuth(int32_t userId);
|
|
|
|
|
|
|
|
binder::Status unlockUserKey(int32_t userId, int32_t userSerial,
|
|
|
|
const std::string& token, const std::string& secret);
|
|
|
|
binder::Status lockUserKey(int32_t userId);
|
|
|
|
|
|
|
|
binder::Status prepareUserStorage(const std::unique_ptr<std::string>& uuid,
|
|
|
|
int32_t userId, int32_t userSerial, int32_t flags);
|
|
|
|
binder::Status destroyUserStorage(const std::unique_ptr<std::string>& uuid,
|
|
|
|
int32_t userId, int32_t flags);
|
|
|
|
|
|
|
|
binder::Status secdiscard(const std::string& path);
|
2017-09-06 21:47:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace vold
|
|
|
|
} // namespace android
|
|
|
|
|
|
|
|
#endif // _VOLD_NATIVE_SERVICE_H_
|