potter: init: update for O

Change-Id: I1668264ac5c6cbfb0d67f7a0f28775fac1d48304
This commit is contained in:
Vachounet
2017-08-22 16:22:35 +02:00
parent 618f0a464a
commit 1eeea0ebdb
2 changed files with 14 additions and 8 deletions

View File

@@ -7,5 +7,7 @@ LOCAL_C_INCLUDES := system/core/init
LOCAL_CPPFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\" LOCAL_CPPFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"
LOCAL_SRC_FILES := init_potter.cpp LOCAL_SRC_FILES := init_potter.cpp
LOCAL_MODULE := libinit_potter LOCAL_MODULE := libinit_potter
LOCAL_STATIC_LIBRARIES := \
libbase
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)

View File

@@ -31,10 +31,12 @@
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h> #include <sys/_system_properties.h>
#include "vendor_init.h" #include <android-base/properties.h>
#include "property_service.h" #include "property_service.h"
#include "log.h" #include "vendor_init.h"
#include "util.h"
namespace android {
namespace init {
void property_override(char const prop[], char const value[]) void property_override(char const prop[], char const value[])
{ {
@@ -50,7 +52,7 @@ void property_override(char const prop[], char const value[])
void num_sims() { void num_sims() {
std::string dualsim; std::string dualsim;
dualsim = property_get("ro.boot.dualsim"); dualsim = android::base::GetProperty("ro.boot.dualsim", "");
property_set("ro.hw.dualsim", dualsim.c_str()); property_set("ro.hw.dualsim", dualsim.c_str());
if (dualsim == "true") { if (dualsim == "true") {
@@ -62,17 +64,17 @@ void num_sims() {
void vendor_load_properties() void vendor_load_properties()
{ {
std::string platform = property_get("ro.board.platform"); std::string platform = android::base::GetProperty("ro.board.platform", "");
if (platform != ANDROID_TARGET) if (platform != ANDROID_TARGET)
return; return;
std::string sku = property_get("ro.boot.hardware.sku"); std::string sku = android::base::GetProperty("ro.boot.hardware.sku", "");
property_override("ro.product.model", sku.c_str()); property_override("ro.product.model", sku.c_str());
// rmt_storage // rmt_storage
std::string device = property_get("ro.boot.device"); std::string device = android::base::GetProperty("ro.boot.device", "");
std::string radio = property_get("ro.boot.radio"); std::string radio = android::base::GetProperty("ro.boot.radio", "");
property_set("ro.hw.device", device.c_str()); property_set("ro.hw.device", device.c_str());
property_set("ro.hw.radio", radio.c_str()); property_set("ro.hw.radio", radio.c_str());
property_set("ro.hw.fps", "true"); property_set("ro.hw.fps", "true");
@@ -93,3 +95,5 @@ void vendor_load_properties()
} }
} }
}
}