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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package android.os;
|
|
|
|
|
2019-12-02 19:50:12 +01:00
|
|
|
import android.os.incremental.IncrementalFileSystemControlParcel;
|
2017-09-13 19:49:44 +02:00
|
|
|
import android.os.IVoldListener;
|
2019-11-19 10:16:03 +01:00
|
|
|
import android.os.IVoldMountCallback;
|
2017-09-15 20:57:44 +02:00
|
|
|
import android.os.IVoldTaskListener;
|
2017-09-13 19:49:44 +02:00
|
|
|
|
2017-09-06 21:47:40 +02:00
|
|
|
/** {@hide} */
|
|
|
|
interface IVold {
|
2017-09-13 19:49:44 +02:00
|
|
|
void setListener(IVoldListener listener);
|
|
|
|
|
2020-04-29 07:49:41 +02:00
|
|
|
void abortFuse();
|
2017-09-16 00:50:28 +02:00
|
|
|
void monitor();
|
2017-09-06 21:47:40 +02:00
|
|
|
void reset();
|
2017-09-07 23:27:28 +02:00
|
|
|
void shutdown();
|
|
|
|
|
|
|
|
void onUserAdded(int userId, int userSerial);
|
|
|
|
void onUserRemoved(int userId);
|
2019-04-29 19:46:35 +02:00
|
|
|
void onUserStarted(int userId);
|
2017-09-07 23:27:28 +02:00
|
|
|
void onUserStopped(int userId);
|
2018-07-31 19:07:34 +02:00
|
|
|
|
|
|
|
void addAppIds(in @utf8InCpp String[] packageNames, in int[] appIds);
|
|
|
|
void addSandboxIds(in int[] appIds, in @utf8InCpp String[] sandboxIds);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
2017-12-15 06:15:20 +01:00
|
|
|
void onSecureKeyguardStateChanged(boolean isShowing);
|
|
|
|
|
2017-09-07 23:27:28 +02:00
|
|
|
void partition(@utf8InCpp String diskId, int partitionType, int ratio);
|
2017-10-24 19:08:45 +02:00
|
|
|
void forgetPartition(@utf8InCpp String partGuid, @utf8InCpp String fsUuid);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
2019-11-19 10:16:03 +01:00
|
|
|
void mount(@utf8InCpp String volId, int mountFlags, int mountUserId,
|
2019-11-27 19:15:14 +01:00
|
|
|
@nullable IVoldMountCallback callback);
|
2017-09-07 23:27:28 +02:00
|
|
|
void unmount(@utf8InCpp String volId);
|
|
|
|
void format(@utf8InCpp String volId, @utf8InCpp String fsType);
|
2017-09-15 20:57:44 +02:00
|
|
|
void benchmark(@utf8InCpp String volId, IVoldTaskListener listener);
|
2017-06-15 17:59:43 +02:00
|
|
|
void checkEncryption(@utf8InCpp String volId);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
2017-09-15 20:57:44 +02:00
|
|
|
void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId,
|
2018-09-19 00:14:18 +02:00
|
|
|
IVoldTaskListener listener);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
|
|
|
void remountUid(int uid, int remountMode);
|
2020-02-28 17:30:47 +01:00
|
|
|
void remountAppStorageDirs(int uid, int pid, in @utf8InCpp String[] packageNames);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
2020-02-12 15:29:02 +01:00
|
|
|
void setupAppDir(@utf8InCpp String path, int appUid);
|
2020-02-18 15:06:37 +01:00
|
|
|
void fixupAppDir(@utf8InCpp String path, int appUid);
|
2017-09-07 23:27:28 +02:00
|
|
|
|
2018-09-19 00:14:18 +02:00
|
|
|
@utf8InCpp String createObb(@utf8InCpp String sourcePath, @utf8InCpp String sourceKey,
|
|
|
|
int ownerGid);
|
2017-09-11 18:32:01 +02:00
|
|
|
void destroyObb(@utf8InCpp String volId);
|
|
|
|
|
2017-09-15 20:57:44 +02:00
|
|
|
void fstrim(int fstrimFlags, IVoldTaskListener listener);
|
2017-10-18 00:41:45 +02:00
|
|
|
void runIdleMaint(IVoldTaskListener listener);
|
|
|
|
void abortIdleMaint(IVoldTaskListener listener);
|
2017-09-11 18:32:01 +02:00
|
|
|
|
2018-10-27 04:56:45 +02:00
|
|
|
FileDescriptor mountAppFuse(int uid, int mountId);
|
|
|
|
void unmountAppFuse(int uid, int mountId);
|
2017-09-11 18:32:01 +02:00
|
|
|
|
2017-09-13 00:30:52 +02:00
|
|
|
void fdeCheckPassword(@utf8InCpp String password);
|
|
|
|
void fdeRestart();
|
|
|
|
int fdeComplete();
|
|
|
|
void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags);
|
|
|
|
void fdeChangePassword(int passwordType, @utf8InCpp String password);
|
|
|
|
void fdeVerifyPassword(@utf8InCpp String password);
|
|
|
|
@utf8InCpp String fdeGetField(@utf8InCpp String key);
|
|
|
|
void fdeSetField(@utf8InCpp String key, @utf8InCpp String value);
|
|
|
|
int fdeGetPasswordType();
|
|
|
|
@utf8InCpp String fdeGetPassword();
|
|
|
|
void fdeClearPassword();
|
|
|
|
|
|
|
|
void fbeEnable();
|
|
|
|
|
|
|
|
void mountDefaultEncrypted();
|
|
|
|
void initUser0();
|
|
|
|
boolean isConvertibleToFbe();
|
2019-06-25 23:44:33 +02:00
|
|
|
void mountFstab(@utf8InCpp String blkDevice, @utf8InCpp String mountPoint);
|
|
|
|
void encryptFstab(@utf8InCpp String blkDevice, @utf8InCpp String mountPoint);
|
2017-09-13 00:30:52 +02:00
|
|
|
|
|
|
|
void createUserKey(int userId, int userSerial, boolean ephemeral);
|
|
|
|
void destroyUserKey(int userId);
|
|
|
|
|
2018-09-19 00:14:18 +02:00
|
|
|
void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token,
|
|
|
|
@utf8InCpp String secret);
|
2019-11-01 06:59:34 +01:00
|
|
|
void clearUserKeyAuth(int userId, int userSerial, @utf8InCpp String token,
|
|
|
|
@utf8InCpp String secret);
|
2017-09-13 00:30:52 +02:00
|
|
|
void fixateNewestUserKeyAuth(int userId);
|
|
|
|
|
2018-09-19 00:14:18 +02:00
|
|
|
void unlockUserKey(int userId, int userSerial, @utf8InCpp String token,
|
|
|
|
@utf8InCpp String secret);
|
2017-09-13 00:30:52 +02:00
|
|
|
void lockUserKey(int userId);
|
|
|
|
|
2018-09-19 00:14:18 +02:00
|
|
|
void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial,
|
|
|
|
int storageFlags);
|
2017-09-13 00:30:52 +02:00
|
|
|
void destroyUserStorage(@nullable @utf8InCpp String uuid, int userId, int storageFlags);
|
|
|
|
|
2018-10-05 01:26:22 +02:00
|
|
|
void prepareSandboxForApp(in @utf8InCpp String packageName, int appId,
|
|
|
|
in @utf8InCpp String sandboxId, int userId);
|
2018-10-25 20:06:55 +02:00
|
|
|
void destroySandboxForApp(in @utf8InCpp String packageName,
|
2018-10-05 01:26:22 +02:00
|
|
|
in @utf8InCpp String sandboxId, int userId);
|
2018-08-24 19:20:56 +02:00
|
|
|
|
2018-10-11 03:52:04 +02:00
|
|
|
void startCheckpoint(int retry);
|
2018-08-28 10:58:49 +02:00
|
|
|
boolean needsCheckpoint();
|
2018-10-03 02:40:44 +02:00
|
|
|
boolean needsRollback();
|
2020-06-11 08:51:17 +02:00
|
|
|
boolean isCheckpointing();
|
2019-03-21 01:02:47 +01:00
|
|
|
void abortChanges(in @utf8InCpp String device, boolean retry);
|
2018-10-11 03:52:04 +02:00
|
|
|
void commitChanges();
|
|
|
|
void prepareCheckpoint();
|
|
|
|
void restoreCheckpoint(@utf8InCpp String device);
|
2019-03-07 02:45:17 +01:00
|
|
|
void restoreCheckpointPart(@utf8InCpp String device, int count);
|
2018-10-11 03:52:04 +02:00
|
|
|
void markBootAttempt();
|
2019-01-23 02:27:25 +01:00
|
|
|
boolean supportsCheckpoint();
|
2019-03-18 21:36:40 +01:00
|
|
|
boolean supportsBlockCheckpoint();
|
|
|
|
boolean supportsFileCheckpoint();
|
2019-10-11 17:38:21 +02:00
|
|
|
void resetCheckpoint();
|
2018-08-28 10:58:49 +02:00
|
|
|
|
2018-10-29 00:52:56 +01:00
|
|
|
@utf8InCpp String createStubVolume(@utf8InCpp String sourcePath,
|
|
|
|
@utf8InCpp String mountPath, @utf8InCpp String fsType,
|
2020-02-04 08:07:21 +01:00
|
|
|
@utf8InCpp String fsUuid, @utf8InCpp String fsLabel, int flags);
|
2018-10-29 00:52:56 +01:00
|
|
|
void destroyStubVolume(@utf8InCpp String volId);
|
|
|
|
|
2018-10-27 04:56:45 +02:00
|
|
|
FileDescriptor openAppFuseFile(int uid, int mountId, int fileId, int flags);
|
|
|
|
|
2020-01-10 20:54:06 +01:00
|
|
|
boolean incFsEnabled();
|
|
|
|
IncrementalFileSystemControlParcel mountIncFs(@utf8InCpp String backingPath, @utf8InCpp String targetDir, int flags);
|
2019-12-02 19:50:12 +01:00
|
|
|
void unmountIncFs(@utf8InCpp String dir);
|
2020-03-31 23:46:25 +02:00
|
|
|
void setIncFsMountOptions(in IncrementalFileSystemControlParcel control, boolean enableReadLogs);
|
2019-12-02 19:50:12 +01:00
|
|
|
void bindMount(@utf8InCpp String sourceDir, @utf8InCpp String targetDir);
|
|
|
|
|
2017-09-13 00:30:52 +02:00
|
|
|
const int ENCRYPTION_FLAG_NO_UI = 4;
|
|
|
|
|
|
|
|
const int ENCRYPTION_STATE_NONE = 1;
|
|
|
|
const int ENCRYPTION_STATE_OK = 0;
|
|
|
|
const int ENCRYPTION_STATE_ERROR_UNKNOWN = -1;
|
|
|
|
const int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2;
|
|
|
|
const int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3;
|
|
|
|
const int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
|
|
|
|
|
2017-09-11 18:32:01 +02:00
|
|
|
const int FSTRIM_FLAG_DEEP_TRIM = 1;
|
|
|
|
|
2017-09-07 23:27:28 +02:00
|
|
|
const int MOUNT_FLAG_PRIMARY = 1;
|
|
|
|
const int MOUNT_FLAG_VISIBLE = 2;
|
|
|
|
|
|
|
|
const int PARTITION_TYPE_PUBLIC = 0;
|
|
|
|
const int PARTITION_TYPE_PRIVATE = 1;
|
|
|
|
const int PARTITION_TYPE_MIXED = 2;
|
|
|
|
|
2017-09-13 00:30:52 +02:00
|
|
|
const int PASSWORD_TYPE_PASSWORD = 0;
|
|
|
|
const int PASSWORD_TYPE_DEFAULT = 1;
|
2018-07-03 20:49:00 +02:00
|
|
|
const int PASSWORD_TYPE_PATTERN = 2;
|
|
|
|
const int PASSWORD_TYPE_PIN = 3;
|
2017-09-13 00:30:52 +02:00
|
|
|
|
|
|
|
const int STORAGE_FLAG_DE = 1;
|
|
|
|
const int STORAGE_FLAG_CE = 2;
|
|
|
|
|
2017-09-07 23:27:28 +02:00
|
|
|
const int REMOUNT_MODE_NONE = 0;
|
|
|
|
const int REMOUNT_MODE_DEFAULT = 1;
|
|
|
|
const int REMOUNT_MODE_READ = 2;
|
|
|
|
const int REMOUNT_MODE_WRITE = 3;
|
2019-01-09 21:15:15 +01:00
|
|
|
const int REMOUNT_MODE_LEGACY = 4;
|
|
|
|
const int REMOUNT_MODE_INSTALLER = 5;
|
|
|
|
const int REMOUNT_MODE_FULL = 6;
|
2019-09-09 11:24:44 +02:00
|
|
|
const int REMOUNT_MODE_PASS_THROUGH = 7;
|
2020-01-08 15:04:21 +01:00
|
|
|
const int REMOUNT_MODE_ANDROID_WRITABLE = 8;
|
2017-09-07 23:27:28 +02:00
|
|
|
|
2017-09-13 19:49:44 +02:00
|
|
|
const int VOLUME_STATE_UNMOUNTED = 0;
|
|
|
|
const int VOLUME_STATE_CHECKING = 1;
|
|
|
|
const int VOLUME_STATE_MOUNTED = 2;
|
|
|
|
const int VOLUME_STATE_MOUNTED_READ_ONLY = 3;
|
|
|
|
const int VOLUME_STATE_FORMATTING = 4;
|
|
|
|
const int VOLUME_STATE_EJECTING = 5;
|
|
|
|
const int VOLUME_STATE_UNMOUNTABLE = 6;
|
|
|
|
const int VOLUME_STATE_REMOVED = 7;
|
|
|
|
const int VOLUME_STATE_BAD_REMOVAL = 8;
|
|
|
|
|
|
|
|
const int VOLUME_TYPE_PUBLIC = 0;
|
|
|
|
const int VOLUME_TYPE_PRIVATE = 1;
|
|
|
|
const int VOLUME_TYPE_EMULATED = 2;
|
|
|
|
const int VOLUME_TYPE_ASEC = 3;
|
|
|
|
const int VOLUME_TYPE_OBB = 4;
|
2018-10-29 00:52:56 +01:00
|
|
|
const int VOLUME_TYPE_STUB = 5;
|
2017-09-06 21:47:40 +02:00
|
|
|
}
|