clover: libinit: Set device specific changes via libinit
Change-Id: I9a2dea3291b76d185d9ecda524a4234b6ed25412
This commit is contained in:
parent
3c6bab5243
commit
b7df175ea3
2 changed files with 35 additions and 36 deletions
|
@ -1,19 +1,29 @@
|
||||||
/*
|
/*
|
||||||
#
|
Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
||||||
# Copyright 2018 The Android Open Source Project
|
Copyright (C) 2016 The CyanogenMod Project.
|
||||||
#
|
Redistribution and use in source and binary forms, with or without
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
modification, are permitted provided that the following conditions are
|
||||||
# you may not use this file except in compliance with the License.
|
met:
|
||||||
# You may obtain a copy of the License at
|
* Redistributions of source code must retain the above copyright
|
||||||
#
|
notice, this list of conditions and the following disclaimer.
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
* Redistributions in binary form must reproduce the above
|
||||||
#
|
copyright notice, this list of conditions and the following
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
disclaimer in the documentation and/or other materials provided
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
with the distribution.
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* Neither the name of The Linux Foundation nor the names of its
|
||||||
# See the License for the specific language governing permissions and
|
contributors may be used to endorse or promote products derived
|
||||||
# limitations under the License.
|
from this software without specific prior written permission.
|
||||||
#
|
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -93,17 +103,20 @@ void vendor_load_properties()
|
||||||
|
|
||||||
char const *hw_id_file = "/sys/devices/platform/HardwareInfo/hw_id";
|
char const *hw_id_file = "/sys/devices/platform/HardwareInfo/hw_id";
|
||||||
|
|
||||||
hw_device = GetProperty("ro.board.variant", "");
|
platform = GetProperty("ro.board.platform", "");
|
||||||
if (hw_device.compare("d9")) {
|
if (platform != ANDROID_TARGET)
|
||||||
property_set ( "ro.vendor.product.model", "MI PAD 4");
|
return;
|
||||||
} else if (hw_device.compare("d9p")) {
|
|
||||||
property_set ( "ro.vendor.product.model", "MI PAD 4 PLUS");
|
|
||||||
}
|
|
||||||
|
|
||||||
ReadFileToString(hw_id_file, &hw_device);
|
ReadFileToString(hw_id_file, &hw_device);
|
||||||
if (hw_device.find("D9P") != std::string::npos) {
|
if (hw_device.find("D9P") != std::string::npos) {
|
||||||
|
property_override("persist.sys.fp.vendor", "fpc");
|
||||||
|
property_override("ro.board.variant", "d9p");
|
||||||
|
property_override("ro.sf.lcd_density", "265");
|
||||||
property_override_dual("ro.product.model", "ro.vendor.product.model", "MI PAD 4 PLUS");
|
property_override_dual("ro.product.model", "ro.vendor.product.model", "MI PAD 4 PLUS");
|
||||||
} else {
|
} else {
|
||||||
|
property_override("persist.sys.fp.vendor", "none");
|
||||||
|
property_override("ro.board.variant", "d9");
|
||||||
|
property_override("ro.sf.lcd_density", "320");
|
||||||
property_override_dual("ro.product.model", "ro.vendor.product.model", "MI PAD 4");
|
property_override_dual("ro.product.model", "ro.vendor.product.model", "MI PAD 4");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -517,18 +517,4 @@ fi
|
||||||
if [ -f /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies ]; then
|
if [ -f /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies ]; then
|
||||||
gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies` 2> /dev/null
|
gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies` 2> /dev/null
|
||||||
setprop ro.gpu.available_frequencies "$gpu_freq"
|
setprop ro.gpu.available_frequencies "$gpu_freq"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set prop for fingerprint identification
|
|
||||||
hw_id=`cat /sys/devices/platform/HardwareInfo/hw_id`
|
|
||||||
hw_device=`echo $hw_id | sed -ne 's/^\([^_]*\)_\([^_]*\)_\([^_]*\).*/\3/p'`
|
|
||||||
case "$hw_device" in
|
|
||||||
"D9" | "NULL" )
|
|
||||||
setprop persist.sys.fp.vendor none
|
|
||||||
setprop ro.board.variant d9
|
|
||||||
;;
|
|
||||||
"D9P" )
|
|
||||||
setprop persist.sys.fp.vendor fpc
|
|
||||||
setprop ro.board.variant d9p
|
|
||||||
;;
|
|
||||||
esac
|
|
Loading…
Reference in a new issue