Loading healthd/BatteryMonitor.cpp +3 −13 Original line number Diff line number Diff line Loading @@ -392,13 +392,12 @@ void BatteryMonitor::updateValues(void) { mHealthInfo->batteryFullChargeDesignCapacityUah = getIntField(mHealthdConfig->batteryFullChargeDesignCapacityUahPath); if (!mHealthdConfig->batteryStateOfHealthPath.isEmpty()) mHealthInfo->batteryStateOfHealth = getIntField(mHealthdConfig->batteryStateOfHealthPath); if (!mHealthdConfig->batteryHealthStatusPath.isEmpty()) mBatteryHealthStatus = getIntField(mHealthdConfig->batteryHealthStatusPath); if (!mHealthdConfig->batteryStateOfHealthPath.isEmpty()) mHealthInfo->batteryHealthData->batteryStateOfHealth = getIntField(mHealthdConfig->batteryStateOfHealthPath); if (!mHealthdConfig->batteryManufacturingDatePath.isEmpty()) mHealthInfo->batteryHealthData->batteryManufacturingDateSeconds = getIntField(mHealthdConfig->batteryManufacturingDatePath); Loading Loading @@ -592,10 +591,6 @@ int BatteryMonitor::getBatteryHealthData(int id) { if (!mHealthdConfig->batteryFirstUsageDatePath.isEmpty()) return getIntField(mHealthdConfig->batteryFirstUsageDatePath); } if (id == BATTERY_PROP_STATE_OF_HEALTH) { if (!mHealthdConfig->batteryStateOfHealthPath.isEmpty()) return getIntField(mHealthdConfig->batteryStateOfHealthPath); } return 0; } Loading Loading @@ -674,11 +669,6 @@ status_t BatteryMonitor::getProperty(int id, struct BatteryProperty *val) { ret = OK; break; case BATTERY_PROP_STATE_OF_HEALTH: val->valueInt64 = getBatteryHealthData(BATTERY_PROP_STATE_OF_HEALTH); ret = OK; break; default: break; } Loading init/init.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/thread_annotations.h> #include <fs_avb/fs_avb.h> #include <fs_mgr_vendor_overlay.h> #include <keyutils.h> Loading Loading @@ -211,16 +212,16 @@ static class PropWaiterState { } private: void ResetWaitForPropLocked() { void ResetWaitForPropLocked() EXCLUSIVE_LOCKS_REQUIRED(lock_) { wait_prop_name_.clear(); wait_prop_value_.clear(); waiting_for_prop_.reset(); } std::mutex lock_; std::unique_ptr<Timer> waiting_for_prop_{nullptr}; std::string wait_prop_name_; std::string wait_prop_value_; GUARDED_BY(lock_) std::unique_ptr<Timer> waiting_for_prop_{nullptr}; GUARDED_BY(lock_) std::string wait_prop_name_; GUARDED_BY(lock_) std::string wait_prop_value_; } prop_waiter_state; Loading Loading @@ -259,7 +260,7 @@ static class ShutdownState { private: std::mutex shutdown_command_lock_; std::string shutdown_command_; std::string shutdown_command_ GUARDED_BY(shutdown_command_lock_); bool do_shutdown_ = false; } shutdown_state; Loading rootdir/init.rc +4 −0 Original line number Diff line number Diff line Loading @@ -925,6 +925,10 @@ on post-fs-data mkdir /data/system/dropbox 0700 system system mkdir /data/system/heapdump 0700 system system mkdir /data/system/users 0775 system system # Mkdir and set SELinux security contexts for shutdown-checkpoints. # TODO(b/270286197): remove these after couple releases. mkdir /data/system/shutdown-checkpoints 0700 system system restorecon_recursive /data/system/shutdown-checkpoints # Create the parent directories of the user CE and DE storage directories. # These parent directories must use encryption=None, since each of their Loading Loading
healthd/BatteryMonitor.cpp +3 −13 Original line number Diff line number Diff line Loading @@ -392,13 +392,12 @@ void BatteryMonitor::updateValues(void) { mHealthInfo->batteryFullChargeDesignCapacityUah = getIntField(mHealthdConfig->batteryFullChargeDesignCapacityUahPath); if (!mHealthdConfig->batteryStateOfHealthPath.isEmpty()) mHealthInfo->batteryStateOfHealth = getIntField(mHealthdConfig->batteryStateOfHealthPath); if (!mHealthdConfig->batteryHealthStatusPath.isEmpty()) mBatteryHealthStatus = getIntField(mHealthdConfig->batteryHealthStatusPath); if (!mHealthdConfig->batteryStateOfHealthPath.isEmpty()) mHealthInfo->batteryHealthData->batteryStateOfHealth = getIntField(mHealthdConfig->batteryStateOfHealthPath); if (!mHealthdConfig->batteryManufacturingDatePath.isEmpty()) mHealthInfo->batteryHealthData->batteryManufacturingDateSeconds = getIntField(mHealthdConfig->batteryManufacturingDatePath); Loading Loading @@ -592,10 +591,6 @@ int BatteryMonitor::getBatteryHealthData(int id) { if (!mHealthdConfig->batteryFirstUsageDatePath.isEmpty()) return getIntField(mHealthdConfig->batteryFirstUsageDatePath); } if (id == BATTERY_PROP_STATE_OF_HEALTH) { if (!mHealthdConfig->batteryStateOfHealthPath.isEmpty()) return getIntField(mHealthdConfig->batteryStateOfHealthPath); } return 0; } Loading Loading @@ -674,11 +669,6 @@ status_t BatteryMonitor::getProperty(int id, struct BatteryProperty *val) { ret = OK; break; case BATTERY_PROP_STATE_OF_HEALTH: val->valueInt64 = getBatteryHealthData(BATTERY_PROP_STATE_OF_HEALTH); ret = OK; break; default: break; } Loading
init/init.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/thread_annotations.h> #include <fs_avb/fs_avb.h> #include <fs_mgr_vendor_overlay.h> #include <keyutils.h> Loading Loading @@ -211,16 +212,16 @@ static class PropWaiterState { } private: void ResetWaitForPropLocked() { void ResetWaitForPropLocked() EXCLUSIVE_LOCKS_REQUIRED(lock_) { wait_prop_name_.clear(); wait_prop_value_.clear(); waiting_for_prop_.reset(); } std::mutex lock_; std::unique_ptr<Timer> waiting_for_prop_{nullptr}; std::string wait_prop_name_; std::string wait_prop_value_; GUARDED_BY(lock_) std::unique_ptr<Timer> waiting_for_prop_{nullptr}; GUARDED_BY(lock_) std::string wait_prop_name_; GUARDED_BY(lock_) std::string wait_prop_value_; } prop_waiter_state; Loading Loading @@ -259,7 +260,7 @@ static class ShutdownState { private: std::mutex shutdown_command_lock_; std::string shutdown_command_; std::string shutdown_command_ GUARDED_BY(shutdown_command_lock_); bool do_shutdown_ = false; } shutdown_state; Loading
rootdir/init.rc +4 −0 Original line number Diff line number Diff line Loading @@ -925,6 +925,10 @@ on post-fs-data mkdir /data/system/dropbox 0700 system system mkdir /data/system/heapdump 0700 system system mkdir /data/system/users 0775 system system # Mkdir and set SELinux security contexts for shutdown-checkpoints. # TODO(b/270286197): remove these after couple releases. mkdir /data/system/shutdown-checkpoints 0700 system system restorecon_recursive /data/system/shutdown-checkpoints # Create the parent directories of the user CE and DE storage directories. # These parent directories must use encryption=None, since each of their Loading