路徑:
frameworks\base\services\usb\java\com\android\server\usb\UsbDeviceManager.java
添加:
import android.service.oemlock.OemLockManager;
protected void finishBoot() {
+ OemLockManager mOemLockManager = (OemLockManager) mContext.getSystemService(Context.OEM_LOCK_SERVICE);
+ mOemLockManager.setOemUnlockAllowedByUser(true);
if (mBootCompleted && mCurrentUsbFunctionsReceived && mSystemReady) {
if (mPendingBootBroadcast) {
updateUsbStateBroadcastIfNeeded(getAppliedFunctions(mCurrentFunctions));
mPendingBootBroadcast = false;
}
.....
步驟:
1、撥碼燒寫模式,全編後全燒
2、撥碼運行模式後啓動
3、啓動完成後重啓進入fastboot模式 (reboot bootloader 或 啓動後按鍵盤,進入u-boot命令行模式,打命令:fastboot 0 回車)
4、此時,可以使用fastboot命令或者開始全燒
a、oem解鎖:fastboot oem unlock
b、查看oem解鎖使能:flashing get_unlock_ability,具體可以打命令fastboot oem --help查看,可能不同板子命令不同
參考: