M harmony_changelog.md => harmony_changelog.md +2 -1
@@ 15,7 15,7 @@
* Fixed settings frontlight intensity in on demand mode
* Fixed problem that UI could be occasionally broken
* Fixed problem with displaying end of title when playing song in loop was selected.
-* Fixed problem with an unresponding device after playing specific WAV files.
+* Fixed problem with an unresponsive device after playing specific WAV files.
* Fixed USB charging port detection.
### Added
@@ 28,6 28,7 @@
* Added new field to deviceInfo endpoint
* Changed order in which files are displayed in Relaxation
* Optimized E-Ink energy consumption
+* Information about device memory is now sent to MC in floating points numbers
## [1.9.0 2023-04-03]
M module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpointCommon.cpp => module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpointCommon.cpp +7 -11
@@ 114,7 114,7 @@ namespace sdesktop::endpoints
return entries;
}
- auto DeviceInfoEndpointCommon::getStorageStats(const std::string &path) -> std::tuple<long, long>
+ auto DeviceInfoEndpointCommon::getStorageStats(const std::string &path) -> std::tuple<float, float>
{
constexpr auto bytesInMebibyte = 1024LLU * 1024LLU;
struct statvfs vfstat
@@ 124,26 124,22 @@ namespace sdesktop::endpoints
return {-1, -1};
}
- const auto totalMbytes = static_cast<long>(
- (static_cast<std::uint64_t>(vfstat.f_blocks) * static_cast<std::uint64_t>(vfstat.f_bsize)) /
- bytesInMebibyte);
- const auto freeMbytes = static_cast<long>(
- (static_cast<std::uint64_t>(vfstat.f_bfree) * static_cast<std::uint64_t>(vfstat.f_bsize)) /
- bytesInMebibyte);
+ const auto totalMbytes = static_cast<float>(vfstat.f_blocks * vfstat.f_bsize) / bytesInMebibyte;
+ const auto freeMbytes = static_cast<float>(vfstat.f_bfree * vfstat.f_bsize) / bytesInMebibyte;
return {totalMbytes, freeMbytes};
}
- auto DeviceInfoEndpointCommon::getStorageInfo() -> std::tuple<long, long, long>
+ auto DeviceInfoEndpointCommon::getStorageInfo() -> std::tuple<float, float, float>
{
/* MuditaOS consists of two system partitions: 'system_a' and 'system_b'.
* However, only one of them is mounted at the time. The value returned
* by the endpoint should take into account space of both of them. */
constexpr auto numberOfSystemPartitions = 2;
- long totalDeviceSpaceMiB = 0;
- long reservedSystemSpaceMiB = 0;
- long usedUserSpaceMiB = 0;
+ float totalDeviceSpaceMiB = 0;
+ float reservedSystemSpaceMiB = 0;
+ float usedUserSpaceMiB = 0;
/* System partitions stats */
const auto systemDiskPath = purefs::dir::getSystemDiskPath();
M module-services/service-desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpointCommon.hpp => module-services/service-desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpointCommon.hpp +3 -3
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
@@ 28,8 28,8 @@ namespace sdesktop::endpoints
auto listDirectory(const std::string &path) -> std::vector<std::string>;
auto fileListToJsonObject(const std::vector<std::string> &fileList) const -> json11::Json::object const;
auto requestLogsFlush() const -> void;
- auto getStorageStats(const std::string &path) -> std::tuple<long, long>;
- auto getStorageInfo() -> std::tuple<long, long, long>;
+ auto getStorageStats(const std::string &path) -> std::tuple<float, float>;
+ auto getStorageInfo() -> std::tuple<float, float, float>;
auto getMtpPath() const -> std::filesystem::path;
explicit DeviceInfoEndpointCommon(sys::Service *ownerServicePtr) : Endpoint(ownerServicePtr)
M pure_changelog.md => pure_changelog.md +1 -0
@@ 19,6 19,7 @@
* Decrease critical battery level from 10% to 5%
* Optimized E-Ink energy consumption
* Changed volume popup timeout to match phone modes popup
+* Information about device memory is now sent to MC in floating points numbers
### Fixed