路径:
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查看,可能不同板子命令不同
参考: