zoukankan      html  css  js  c++  java
  • I.MX6 默认打开 USB adb

    /*****************************************************************************
     *                        I.MX6 默认打开 USB adb
     * 声明:
     *     在调试android的时候,尤其是前期,可能我们没有Touch,这样使用adb显得
     * 力不从心,因为它会弹个对话框来,可你有按不了,于是默认打开adb就成了需求。
     *
     *                                          2016-1-20 深圳 南山平山村 曾剑锋
     ****************************************************************************/
    
    一、参考文章:
        飞思卡尔 imx6 android 调试环境搭建
            http://www.wjxfpf.com/2015/10/590190.html
        Android 4.2.2 开机默认开启USB调试
            http://blog.csdn.net/zhujm320/article/details/37914487
        默认打开USB调试功能
            http://blog.csdn.net/pfgmylove/article/details/16985159
    
    二、解决方案:
        1. cat frameworks/base/services/java/com/android/server/usb/UsbDeviceManager.java
            ......
            public void systemReady() {
                if (DEBUG) Slog.d(TAG, "systemReady");
                mNotificationManager = (NotificationManager)
                    mContext.getSystemService(Context.NOTIFICATION_SERVICE);
    
                // We do not show the USB notification if the primary volume supports mass storage.
                // The legacy mass storage UI will be used instead.
                boolean massStorageSupported = false;
                final StorageManager storageManager = StorageManager.from(mContext);
                final StorageVolume primary = storageManager.getPrimaryVolume();
                massStorageSupported = primary != null && primary.allowMassStorage();
                mUseUsbNotification = !massStorageSupported;
    
    
                // make sure the ADB_ENABLED setting value matches the current state
                //Settings.Global.putInt(mContentResolver, Settings.Global.ADB_ENABLED, mAdbEnabled ? 1 : 0);
                Settings.Global.putInt(mContentResolver, Settings.Global.ADB_ENABLED, 1); 
                mHandler.sendEmptyMessage(MSG_SYSTEM_READY);
            }
            ......
        2. cat /init.rc
            ......
            #  Enable adb security for JB4.2.2
                setprop ro.adb.secure 0
            ......
        
  • 相关阅读:
    python 抓取网页
    Vim XDebug调试PHP php远程调试
    10 条 nmap 技巧
    Linux修改文件及文件夹权限
    mysql 常用命令 汇总
    VS2010打开过多的IntelliTrace.exe进程导致虚拟内存不足的解决办法
    黄聪:MYSQL远程连接失败:ERROR 1130: mysql 1130连接错误的有效解決方法
    黄聪:WordPress搬家更换域名教程
    黄聪:使用 ALinq 实现 Linq to MySQL【转】
    黄聪:Filezilla 二进制上传设定
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/5145350.html
Copyright © 2011-2022 走看看