編譯調試
adb root & adb remount
- 單獨編譯frameworks mmm frameworks/base/services/
adb root & adb remount
adb push Z:\oywj\905\out\target\product\u202\system\framework\services.core.jar /system/framework
adb push Z:\oywj\905\out\target\product\u202\system\framework\services.jar /system/framework
adb push Z:\oywj\905\out\target\product\u202\system\framework\services.jar.prof /system/framework
adb push Z:\oywj\905\out\target\product\u202\system\framework\oat\arm\services.art /system/framework/oat/arm/
adb push Z:\oywj\905\out\target\product\u202\system\framework\oat\arm\services.core.odex /system/framework/oat/arm/
adb push Z:\oywj\905\out\target\product\u202\system\framework\oat\arm\services.core.vdex /system/framework/oat/arm/
adb push Z:\oywj\905\out\target\product\u202\system\framework\oat\arm\services.odex /system/framework/oat/arm/
adb push Z:\oywj\905\out\target\product\u202\system\framework\oat\arm\services.vdex /system/framework/oat/arm/
adb reboot
將文件push進取之后,重啟生效
- 單獨編譯mmm frameworks/base/core/res/
adb push Z:\oywj\905\out\target\product\u202\system\framework\framework-res.apk /system/framework
- SettingsProvider 部分編譯 mmma frameworks/base/packages/SettingsProvider/
adb push Z:\oywj\905\out\target\product\u202\system\priv-app\SettingsProvider /system/priv-app
恢復出廠設置來重新創(chuàng)建DataBaseHelper.java settings.db數(shù)據(jù), loadSettings(db); System皿曲、Secure酣藻、Global
cat /dev/block/env Env值
cat /proc/sys/kernel/printk 7 4 1 7 //打印控制臺日志等級
系統(tǒng)方案
- Android O 之后獲取保存 Wifi 密碼锭沟,解析/data/misc/wifi/WifiConfigStore.xml文件
/**
* 傳入需要查詢WIfi的名稱(ssid), 項目是已經連接的Wifi
*/
private String readWifiPreSharedKey(String ssid){
Process process = null;
DataOutputStream dataOutputStream = null;
InputStream inputStream = null;
StringBuffer wifiConf = new StringBuffer();
try {
process = Runtime.getRuntime().exec("su");
dataOutputStream = new DataOutputStream(process.getOutputStream());
inputStream = process.getInputStream();
dataOutputStream
.writeBytes("cat /data/misc/wifi/WifiConfigStore.xml\n");
dataOutputStream.writeBytes("exit\n");
dataOutputStream.flush();
XmlPullParser xmlPullParser = Xml.newPullParser();
xmlPullParser.setInput(inputStream,"UTF-8");
int eventType = xmlPullParser.getEventType();
boolean isWifiInfo = false;
boolean isConnectWifi = false;
while(eventType != XmlPullParser.END_DOCUMENT){
switch (eventType) {
case XmlPullParser.START_DOCUMENT:
break;
case XmlPullParser.START_TAG:
String startTag = xmlPullParser.getName();
if(startTag.equals("WifiConfiguration")){
isWifiInfo = true;
break;
}
if(isWifiInfo) {
String name = xmlPullParser.getAttributeValue(null, "name");
if ("SSID".equals(name)) {
String _ssid = xmlPullParser.nextText();
if (_ssid.substring(1,_ssid.length() - 1).equals(ssid)) {
isConnectWifi = true;
break;
}
} else if (isConnectWifi && "PreSharedKey".equals(name)) {
String PreSharedKey = xmlPullParser.nextText();
return PreSharedKey.substring(1,PreSharedKey.length() - 1);
}
}
break;
case XmlPullParser.END_TAG:/**【元素結束事件】**/
String endTag = xmlPullParser.getName();
if(endTag.equals("WifiConfiguration"))
isWifiInfo = false;
break;
}
eventType = xmlPullParser.next();
}
process.waitFor();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (dataOutputStream != null) {
dataOutputStream.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
process.destroy();
}
return "";
}
靜默開機方案
- Amlogic905平臺 9.0
---- setDisplayInfoOverrideFromWindowManagerInternal
涉及git倉庫:bootloader尔当、common(kernel)坞靶、Customer憔狞、device、frameworks彰阴、packages
- 屏蔽Logo
bootloader/uboot-repo/bl33/board/amlogic/g12a_u202_v1/g12a_u202_v1.c
setenv("board_defined_bootup", "bootup_D3"); -> setenv("board_defined_bootup", "bootup_quiescent");
設置圖片名稱用靜默(全黑)圖片替換 device/amlogic/u202/logo_img_files/bootup_D3.bmp
bootloader/uboot-repo/bl33/common/cmd_imgread.c
[do_image_read_pic] ---- bootupOutmode[1] = picName = getenv("board_defined_bootup");
SystemControlManager.setenv
- 屏蔽開機動畫
property: debug.sf.nobootanimation=1
*. 屏蔽開機動畫之后屏幕喚醒
--- a/base/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/base/services/core/java/com/android/server/power/PowerManagerService.java
- mWakefulness = WAKEFULNESS_AWAKE;
-
+ mWakefulness = WAKEFULNESS_ASLEEP;
+ mHandler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ Slog.d(TAG, "PowerManagerService [wakeUp] delay 15s");
+ //new BinderService().wakeUp(SystemClock.uptimeMillis(), "android.policy:POWER", "android");
+ wakeUpInternal(SystemClock.uptimeMillis(), "android.policy:POWER",
+ Process.SYSTEM_UID, "android",Process.SYSTEM_UID);
+ goToSleepInternal(SystemClock.uptimeMillis(), PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON
+ , 0,Process.SYSTEM_UID);
+ }
+ },15 * 1000);
*. 屏蔽背光
1) logo 背光 在bootloader層
2) 開機動畫背光
3) Android系統(tǒng)背光
- Hisi3751V811平臺 8.
涉及倉庫 packages躯喇、frameworks、Customer、bigfish廉丽、sdk
和Amlogic不同倦微,海思并沒有提供設置Boot Env的接口,不僅沒有接口而且背光控制完全在Boot中(fastboot).
- 海思提供通過分區(qū)偏移地址讀寫接口 hi_flash.h
hFlash = HI_Flash_OpenByName(CUSTOM_DEVICE_NAME);
if(HI_INVALID_HANDLE != hFlash
{
stMtdInfo.u32Offset = CUSTOM_SLIENT_BOOT_OFFFSET;
(HI_VOID)HI_Flash_GetInfo(hFlash, &stFlashInfo);
stMtdInfo.u32Size = stFlashInfo.PartSize;
}
u32ReadLenth = stFlashInfo.PageSize > CUSTOM_DEF_DEVPARAM_SIZE ? stFlashInfo.PageSize : CUSTOM_DEF_DEVPARAM_SIZE;
if (0 == u32ReadLenth)
{
CUSTOM_LOG("ERR: u32ReadLenth, can not pass 0 to malloc\n");
return HI_FAILURE;
}
pBuf = (HI_U8 *)malloc(u32ReadLenth);
if (HI_NULL == pBuf)
{
CUSTOM_LOG("malloc buf err!");
s32Ret = HI_FAILURE;
goto FLASH_CLOSE;
}
memset(pBuf, 0x0, u32ReadLenth);
ReadLen = HI_Flash_Read(hFlash, (HI_U64)stMtdInfo.u32Offset, (HI_U8 *)pBuf, u32ReadLenth, HI_FLASH_RW_FLAG_RAW);
if(ReadLen < 0)
{
CUSTOM_LOG("ERR: HI_Flash_Read!");
s32Ret = HI_FAILURE;
goto FREE_BUF;
}
u32SlientBootStatus = ((HI_CUSTOM_DEV_PARAM_S*)pBuf)->u32PanelIndex;
FREE_BUF:
if (HI_NULL != pBuf)
{
free(pBuf);
}
FLASH_CLOSE:
HI_Flash_Close(hFlash);
RET:
return s32Ret;
- 獲取值設置背光 msp/drv/panel/drv_panel_power.c kernel 層對msp做軟連接
PANEL_DRV_SetPanelBlPowerTimer接口內通過獲取u32SlientBootStatus判斷是否為靜默開機正压,從而屏蔽背光流程
C:Picture.cpp 開機啟動時和Boot同步 enableBacklight
Java:PictureImpl.java 給Java曾的接口
屏蔽串口打印
u202:/proc/sys/kernel $ cat printk
7 4 1 7
+# -- 設置log等級 -- #
+if [[ "TYPE_LOG_LEVEL" = "CONSOLE_LOGLEVEL_MIN" || "TYPE_LOG_LEVEL" = "CONSOLE_LOGLEVEL_DEFAULT" || "TYPE_LOG_LEVEL" = "CONSOLE_LOGLEVEL_MOTORMOUTH" ]];then
- echo "$A905D3_CONSOLE_LOGLEVEL"
- sed -i 's/CONSOLE_LOGLEVEL_DEFAULT,.*/*\ console_loglevel\ *//'A905D3_CONSOLE_LOGLEVEL
+fi
uboot-repo/bl33/board/amlogic/configs/g12a_u202_v1.h
Customer
common
kernel/printk/printk.c
GoolgePlay
android.software.google_atv.xml > vendor