pmt: revert 7f8090b
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* 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
|
||||
* 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,
|
||||
@@ -16,7 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define INC_MAIN_LIBS 1
|
||||
#define INC_MAIN_LIBS
|
||||
|
||||
#include <PartitionManager/PartitionManager.h>
|
||||
#include <sys/system_properties.h>
|
||||
@@ -24,51 +24,51 @@
|
||||
static int
|
||||
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);
|
||||
char val[PROP_VALUE_MAX];
|
||||
int len = __system_property_get(property, val);
|
||||
|
||||
VLOGD("Get property value: '%s'\n", property);
|
||||
if (len > 0)
|
||||
{
|
||||
VLOGD("%s=%s\n", property, val);
|
||||
VLOGD("Get property value: '%s'\n", property);
|
||||
if (len > 0)
|
||||
{
|
||||
VLOGD("%s=%s\n", property, val);
|
||||
|
||||
VLOGD("Comparing '%s' property value '%s'\n", property, val1);
|
||||
if (strcmp(val, val1) == 0)
|
||||
{
|
||||
VLOGD("'%s' is '%s'. Stop (0).\n", property, val1);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("'%s' property is not '%s'. Comparing desired value 2 (if speficed).\n", property, val1);
|
||||
VLOGD("Comparing '%s' property value '%s'\n", property, val1);
|
||||
if (strcmp(val, val1) == 0)
|
||||
{
|
||||
VLOGD("'%s' is '%s'. Stop (0).\n", property, val1);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("'%s' property is not '%s'. Comparing desired value 2 (if speficed).\n", property, val1);
|
||||
|
||||
if (val2 != nullptr)
|
||||
{
|
||||
if (strcmp(val, val2) == 0)
|
||||
{
|
||||
VLOGD("'%s' is '%s'.Stop (0).\n", property, val2);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("'%s' is not '%s'. Stop (1).\n", property, val2);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("'%s' is not '%s'. Stop (1).\n", property, val1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("Cannot get property '%s'. No such property or empty. Stop (1).\n", property);
|
||||
return 1;
|
||||
}
|
||||
if (val2 != nullptr)
|
||||
{
|
||||
if (strcmp(val, val2) == 0)
|
||||
{
|
||||
VLOGD("'%s' is '%s'.Stop (0).\n", property, val2);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("'%s' is not '%s'. Stop (1).\n", property, val2);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("'%s' is not '%s'. Stop (1).\n", property, val1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VLOGE("Cannot get property '%s'. No such property or empty. Stop (1).\n", property);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 2;
|
||||
return 2;
|
||||
}
|
||||
|
||||
using namespace PartitionManager;
|
||||
@@ -76,17 +76,17 @@ using namespace PartitionManager;
|
||||
/* check parts */
|
||||
void PartitionManager::CheckDevPoint(void)
|
||||
{
|
||||
/* true = ab | false = a only */
|
||||
Config.UsesSlots = (GetProperty("ro.boot.slot_suffix", "_a", "_b") == 0 || GetProperty("ro.boot.slot", "_a", "_b") == 0) ? true : false;
|
||||
/* true = ab | false = a only */
|
||||
Config.UsesSlots = (GetProperty("ro.boot.slot_suffix", "_a", "_b") == 0 || GetProperty("ro.boot.slot", "_a", "_b") == 0) ? true : false;
|
||||
|
||||
if (Config.UsesSlots)
|
||||
VLOGW("1 warning generated: A/B partitions status.\n");
|
||||
if (Config.UsesSlots)
|
||||
VLOGW("1 warning generated: A/B partitions status.\n");
|
||||
|
||||
/* true = logical | false = normal */
|
||||
Config.UsesLogical = (GetProperty("ro.boot.dynamic_partitions", "true") == 0) ? true : false;
|
||||
/* true = logical | false = normal */
|
||||
Config.UsesLogical = (GetProperty("ro.boot.dynamic_partitions", "true") == 0) ? true : false;
|
||||
|
||||
if (Config.UsesLogical)
|
||||
VLOGW("1 warning generated: logical partitions status.\n");
|
||||
if (Config.UsesLogical)
|
||||
VLOGW("1 warning generated: logical partitions status.\n");
|
||||
}
|
||||
|
||||
/* end of code */
|
||||
|
||||
Reference in New Issue
Block a user