Remove CheckBattery altogether
Test: changed Angler fstab to encryptable and encrypted. Bug: 16868177 Change-Id: I17d36ea838d6d96f0752b2d6d03b1f9a781ed018
This commit is contained in:
parent
c8e7d35237
commit
5385417922
5 changed files with 0 additions and 86 deletions
|
@ -10,7 +10,6 @@ common_src_files := \
|
||||||
fs/Vfat.cpp \
|
fs/Vfat.cpp \
|
||||||
Loop.cpp \
|
Loop.cpp \
|
||||||
Devmapper.cpp \
|
Devmapper.cpp \
|
||||||
CheckBattery.cpp \
|
|
||||||
Ext4Crypt.cpp \
|
Ext4Crypt.cpp \
|
||||||
VoldUtil.cpp \
|
VoldUtil.cpp \
|
||||||
cryptfs.cpp \
|
cryptfs.cpp \
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2014 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LOG_TAG "VoldCheckBattery"
|
|
||||||
#include <cutils/log.h>
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
int is_battery_ok_to_start()
|
|
||||||
{
|
|
||||||
// Bug 16868177 exists to purge this code completely
|
|
||||||
return true; //is_battery_ok(START_THRESHOLD);
|
|
||||||
}
|
|
||||||
|
|
||||||
int is_battery_ok_to_continue()
|
|
||||||
{
|
|
||||||
// Bug 16868177 exists to purge this code completely
|
|
||||||
return true; //is_battery_ok(CONTINUE_THRESHOLD);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2014 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 _CHECKBATTERY_H__
|
|
||||||
#define _CHECKBATTERY_H__
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int is_battery_ok_to_start();
|
|
||||||
int is_battery_ok_to_continue();
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "cutils/properties.h"
|
#include "cutils/properties.h"
|
||||||
#define LOG_TAG "EncryptInplace"
|
#define LOG_TAG "EncryptInplace"
|
||||||
#include "cutils/log.h"
|
#include "cutils/log.h"
|
||||||
#include "CheckBattery.h"
|
|
||||||
|
|
||||||
// HORRIBLE HACK, FIXME
|
// HORRIBLE HACK, FIXME
|
||||||
#include "cryptfs.h"
|
#include "cryptfs.h"
|
||||||
|
@ -244,13 +243,6 @@ static int encrypt_groups(struct encryptGroupsData* data)
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_battery_ok_to_continue()) {
|
|
||||||
SLOGE("Stopping encryption due to low battery");
|
|
||||||
rc = 0;
|
|
||||||
goto errout;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (flush_outstanding_data(data)) {
|
if (flush_outstanding_data(data)) {
|
||||||
goto errout;
|
goto errout;
|
||||||
|
@ -573,13 +565,6 @@ static int cryptfs_enable_inplace_full(char *crypto_blkdev, char *real_blkdev,
|
||||||
CRYPT_SECTORS_PER_BUFSIZE,
|
CRYPT_SECTORS_PER_BUFSIZE,
|
||||||
i * CRYPT_SECTORS_PER_BUFSIZE);
|
i * CRYPT_SECTORS_PER_BUFSIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_battery_ok_to_continue()) {
|
|
||||||
SLOGE("Stopping encryption due to low battery");
|
|
||||||
*size_already_done += (i + 1) * CRYPT_SECTORS_PER_BUFSIZE - 1;
|
|
||||||
rc = 0;
|
|
||||||
goto errout;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do any remaining sectors */
|
/* Do any remaining sectors */
|
||||||
|
|
|
@ -57,7 +57,6 @@
|
||||||
#include "VoldUtil.h"
|
#include "VoldUtil.h"
|
||||||
#include "Ext4Crypt.h"
|
#include "Ext4Crypt.h"
|
||||||
#include "f2fs_sparseblock.h"
|
#include "f2fs_sparseblock.h"
|
||||||
#include "CheckBattery.h"
|
|
||||||
#include "EncryptInplace.h"
|
#include "EncryptInplace.h"
|
||||||
#include "Process.h"
|
#include "Process.h"
|
||||||
#include "Keymaster.h"
|
#include "Keymaster.h"
|
||||||
|
@ -2010,11 +2009,6 @@ static int cryptfs_enable_all_volumes(struct crypt_mnt_ftr *crypt_ftr, int how,
|
||||||
off64_t cur_encryption_done=0, tot_encryption_size=0;
|
off64_t cur_encryption_done=0, tot_encryption_size=0;
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
if (!is_battery_ok_to_start()) {
|
|
||||||
SLOGW("Not starting encryption due to low battery");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The size of the userdata partition, and add in the vold volumes below */
|
/* The size of the userdata partition, and add in the vold volumes below */
|
||||||
tot_encryption_size = crypt_ftr->fs_size;
|
tot_encryption_size = crypt_ftr->fs_size;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue