/*******************************************************************
* I.MX6 默认打开 USB adb
* 声明:
* 在调试android的时候,尤其是前期,可能我们没有Touch,这样使用adb显得
* 力不从心,因为它会弹个对话框来,可你有按不了,于是默认打开adb就成了需求。
*
******************************************************************/

一、参考文章:
飞思卡尔 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        ......

更多相关文章

  1. android使用keystore打包错误解决方法
  2. 如何快速修改/更换android应用的包名
  3. android 显示单选列表对话框 builder.setSingleChoiceItems
  4. Android(安卓)对话框
  5. Android(安卓)数独游戏 记录
  6. Android中ListView包含CheckBox时滑动丢失选中状态的解决
  7. android5.1 取消录制屏幕跳出的权限对话框
  8. Android(安卓)WebView封装及定制js的alert,confirm和prompt对话
  9. 如何锁定横屏或竖屏

随机推荐

  1. Navicat Premium15连接云服务器中的数据
  2. 通过Query Profiler查看MySQL语句运行时
  3. MySQL 撤销日志与重做日志(Undo Log与Red
  4. mysql常用sql与命令之从入门到删库跑路
  5. 详解MySQL 查询语句的执行过程
  6. MySQL EXPLAIN语句的使用示例
  7. mysql 行列转换的示例代码
  8. 详解MySQL 数据库隔离级别与MVCC
  9. 解决mysql删除用户 bug的问题
  10. 详解分析MySQL8.0的内存消耗