pmt: initial 2.9.6 release [source]

This commit is contained in:
2024-10-26 11:03:52 +03:00
parent ce7fcae4a4
commit 638062c42f
43 changed files with 672 additions and 10601 deletions

View File

@@ -22,49 +22,49 @@
#include <sys/system_properties.h>
static int
GetProperty(const char* _Nonnull property, const char* desired_val, const char* desired_val2 = nullptr)
GetProperty(const char* _Nonnull property, const char* _Nonnull val1, const char* _Nullable val2 = nullptr)
{
char val[PROP_VALUE_MAX];
int len = __system_property_get(property, val);
VLOGD("GetProperty: get property value: '%s'\n", property);
VLOGD("Get property value: '%s'\n", property);
if (len > 0)
{
VLOGD("GetProperty: %s=%s\n", property, val);
VLOGD("%s=%s\n", property, val);
VLOGD("GetProperty: comparing '%s' property value '%s'\n", property, desired_val);
if (strcmp(val, desired_val) == 0)
VLOGD("Comparing '%s' property value '%s'\n", property, val1);
if (strcmp(val, val1) == 0)
{
VLOGD("GetProperty: '%s' is '%s'. Stop (0).\n", property, desired_val);
VLOGD("'%s' is '%s'. Stop (0).\n", property, val1);
return 0;
}
else
{
VLOGE("GetProperty: '%s' property is not '%s'. Comparing desired value 2 (if speficed).\n", property, desired_val);
VLOGE("'%s' property is not '%s'. Comparing desired value 2 (if speficed).\n", property, val1);
if (desired_val2 != nullptr)
if (val2 != nullptr)
{
if (strcmp(val, desired_val2) == 0)
if (strcmp(val, val2) == 0)
{
VLOGD("GetProperty: '%s' is '%s'.Stop (0).\n", property, desired_val2);
VLOGD("'%s' is '%s'.Stop (0).\n", property, val2);
return 0;
}
else
{
VLOGE("GetProperty: '%s' is not '%s'. Stop (1).\n", property, desired_val2);
VLOGE("'%s' is not '%s'. Stop (1).\n", property, val2);
return 1;
}
}
else
{
VLOGE("GetProperty: '%s' is not '%s'. Stop (1).\n", property, desired_val);
VLOGE("'%s' is not '%s'. Stop (1).\n", property, val1);
return 1;
}
}
}
else
{
VLOGE("GetProperty: cannot get property '%s'. No such property or empty. Stop (1).\n", property);
VLOGE("Cannot get property '%s'. No such property or empty. Stop (1).\n", property);
return 1;
}
@@ -74,19 +74,19 @@ GetProperty(const char* _Nonnull property, const char* desired_val, const char*
using namespace PartitionManager;
/* check parts */
void Functions::CheckDevPoint(void)
void PartitionManager::CheckDevPoint(void)
{
/* true = ab | false = a only */
Booleans::UsesSlots = (GetProperty("ro.boot.slot_suffix", "_a", "_b") == 0 || GetProperty("ro.boot.slot", "_a", "_b") == 0) ? true : false;
Config.UsesSlots = (GetProperty("ro.boot.slot_suffix", "_a", "_b") == 0 || GetProperty("ro.boot.slot", "_a", "_b") == 0) ? true : false;
if (Booleans::UsesSlots)
VLOGW("CheckDevPoint: 1 warning generated: A/B partitions status.\n");
if (Config.UsesSlots)
VLOGW("1 warning generated: A/B partitions status.\n");
/* true = logical | false = normal */
Booleans::UsesLogical = (GetProperty("ro.boot.dynamic_partitions", "true") == 0) ? true : false;
Config.UsesLogical = (GetProperty("ro.boot.dynamic_partitions", "true") == 0) ? true : false;
if (Booleans::UsesLogical)
VLOGW("CheckDevPoint: 1 warning generated: logical partitions status.\n");
if (Config.UsesLogical)
VLOGW("1 warning generated: logical partitions status.\n");
}
/* end of code */