forked from TeamWin/android_device_xiaomi_ginkgo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I001ae78088eb46a456f239ff2df7af93d4f12c99
- Loading branch information
Showing
8 changed files
with
112 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cc_library_static { | ||
name: "libinit_ginkgo", | ||
header_libs: [ | ||
"libbase_headers", | ||
], | ||
cflags: [ | ||
"-Wall", | ||
], | ||
static_libs: [ | ||
"libbase", | ||
], | ||
srcs: ["init_ginkgo.cpp"], | ||
recovery_available: true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <fcntl.h> | ||
#include <unistd.h> | ||
#include <android-base/properties.h> | ||
#include <android-base/logging.h> | ||
#include <sys/resource.h> | ||
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ | ||
#include <sys/_system_properties.h> | ||
|
||
using android::base::GetProperty; | ||
|
||
void property_override(const std::string& name, const std::string& value) | ||
{ | ||
size_t valuelen = value.size(); | ||
|
||
prop_info* pi = (prop_info*) __system_property_find(name.c_str()); | ||
if (pi != nullptr) { | ||
__system_property_update(pi, value.c_str(), valuelen); | ||
} | ||
else { | ||
int rc = __system_property_add(name.c_str(), name.size(), value.c_str(), valuelen); | ||
if (rc < 0) { | ||
LOG(ERROR) << "property_set(\"" << name << "\", \"" << value << "\") failed: " | ||
<< "__system_property_add failed"; | ||
} | ||
} | ||
} | ||
|
||
void model_property_override(const std::string& device, const std::string& model) | ||
{ | ||
property_override("ro.product.device", device); | ||
property_override("ro.product.odm.device", device); | ||
property_override("ro.product.system.device", device); | ||
property_override("ro.product.vendor.device", device); | ||
property_override("ro.build.product", device); | ||
property_override("ro.product.name", device); | ||
property_override("ro.product.odm.name", device); | ||
property_override("ro.product.product.device", device); | ||
property_override("ro.product.product.name", device); | ||
property_override("ro.product.system.name", device); | ||
property_override("ro.product.system_ext.device", device); | ||
property_override("ro.product.system_ext.name", device); | ||
property_override("ro.product.vendor.name", device); | ||
property_override("ro.product.model", model); | ||
property_override("ro.product.odm.model", model); | ||
property_override("ro.product.system.model", model); | ||
property_override("ro.product.vendor.model", model); | ||
property_override("ro.product.product.model", model); | ||
property_override("ro.product.system_ext.model", model); | ||
} | ||
|
||
void vendor_load_properties() { | ||
const std::string hwc = GetProperty("ro.boot.hwc", ""); | ||
if (hwc == "Global_B") { | ||
model_property_override("willow", "Redmi Note 8T"); | ||
} else if (hwc == "Global") { | ||
model_property_override("ginkgo", "Redmi Note 8"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<manifest version="1.0" type="framework"> | ||
<hal> | ||
<name>android.hidl.allocator</name> | ||
<transport>hwbinder</transport> | ||
<version>1.0</version> | ||
<interface> | ||
<name>IAllocator</name> | ||
<instance>ashmem</instance> | ||
</interface> | ||
</hal> | ||
</manifest> |
12 changes: 7 additions & 5 deletions
12
recovery/root/system/etc/vintf/manifest/android.system.keystore2-service.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<manifest version="1.0" type="framework"> <hal | ||
format="aidl"> | ||
<name>android.system.keystore2</name> <interface> | ||
<name>IKeystoreService</name> | ||
<manifest version="1.0" type="framework"> | ||
<hal format="aidl"> | ||
<name>android.system.keystore2</name> | ||
<interface> | ||
<name>IKeystoreService</name> | ||
<instance>default</instance> | ||
</interface> </hal> | ||
</interface> | ||
</hal> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<manifest version="1.0" type="framework"> | ||
<hal> | ||
<name>android.system.suspend</name> | ||
<transport>hwbinder</transport> | ||
<version>1.0</version> | ||
<interface> | ||
<name>ISystemSuspend</name> | ||
<instance>default</instance> | ||
</interface> | ||
</hal> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters