[RK3288][Android6.0] 调试笔记 --- user版本默认显示开发者选项【转】
本文转载自:https://blog.csdn.net/kris_fei/article/details/70157137
Platform: ROCKCHIP
OS: Android 6.0
Kernel: 3.10.92
默认user版本不显示开发者选项这一栏,需要通过连续点击版本号7次来显示.
packages\apps\Settings\src\com\android\settings\DeviceInfoSettings.java
- static final int TAPS_TO_BE_A_DEVELOPER = 7;
- public void onResume() {
- super.onResume();
- mDevHitCountdown = getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE,
- Context.MODE_PRIVATE).getBoolean(DevelopmentSettings.PREF_SHOW,
- android.os.Build.TYPE.equals("eng")) ? -1 : TAPS_TO_BE_A_DEVELOPER;
- mDevHitToast = null;
- }
- public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
- ......
- if (mDevHitCountdown > 0) {
- mDevHitCountdown--;
- if (mDevHitCountdown == 0) {
- getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE,
- Context.MODE_PRIVATE).edit().putBoolean(
- DevelopmentSettings.PREF_SHOW, true).apply();
- if (mDevHitToast != null) {
- mDevHitToast.cancel();
- }
- mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_on,
- Toast.LENGTH_LONG);
- mDevHitToast.show();
- // This is good time to index the Developer Options
- Index.getInstance(
- getActivity().getApplicationContext()).updateFromClassNameResource(
- DevelopmentSettings.class.getName(), true, true);
- } else if (mDevHitCountdown > 0
- && mDevHitCountdown < (TAPS_TO_BE_A_DEVELOPER-2)) {
- if (mDevHitToast != null) {
- mDevHitToast.cancel();
- }
- mDevHitToast = Toast.makeText(getActivity(), getResources().getQuantityString(
- R.plurals.show_dev_countdown, mDevHitCountdown, mDevHitCountdown),
- Toast.LENGTH_SHORT);
- mDevHitToast.show();
- }
- } else if (mDevHitCountdown < 0) { //点击完7次之后显示
- if (mDevHitToast != null) {
- mDevHitToast.cancel();
- }
- mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_already,
- Toast.LENGTH_LONG);
- mDevHitToast.show();
- }
- }
- ......
- }
而默认开机是否显示由变量showDev控制
packages\apps\Settings\src\com\android\settings\SettingsActivity.java
- private void updateTilesList(List<DashboardCategory> target) {
- final boolean showDev = mDevelopmentPreferences.getBoolean(
- DevelopmentSettings.PREF_SHOW,
- android.os.Build.TYPE.equals("eng")); //因此eng才返回true
- ......
- } else if (id == R.id.development_settings) {
- if (!showDev || um.hasUserRestriction(
- UserManager.DISALLOW_DEBUGGING_FEATURES)) {
- removeTile = true; //showDev为false则不显示
- }
- }
- }
解决方法:
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 645add3..11a9c55 100755
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -1236,9 +1236,11 @@ public class SettingsActivity extends Activity
}
private void updateTilesList(List<DashboardCategory> target) {
- final boolean showDev = mDevelopmentPreferences.getBoolean(
- DevelopmentSettings.PREF_SHOW,
- android.os.Build.TYPE.equals("eng"));
+ /*Kris, 170413, show development options anytime.*/
+ // final boolean showDev = mDevelopmentPreferences.getBoolean(
+ // DevelopmentSettings.PREF_SHOW,
+ //android.os.Build.TYPE.equals("eng"));
+ final boolean showDev = true;
[RK3288][Android6.0] 调试笔记 --- user版本默认显示开发者选项【转】的更多相关文章
- [RK3288][Android6.0] 调试笔记 --- Goodix GT9和GT9F区别【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/78341425 Platform: RK3288 OS: Android 6.0 Kernel ...
- [RK3288][Android6.0] 调试笔记 --- 系统识别不同硬件版本方法【转】
本文转载自:http://m.blog.csdn.net/kris_fei/article/details/70226451 Platform: RockchipOS: Android 6.0Kern ...
- [RK3288][Android6.0] 调试笔记 --- 替换系统签名【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/55100299 Platform: RK3288OS: Android 6.0Kernel: ...
- [RK3288][Android6.0] 调试笔记 --- 普通串口的添加 【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/54574073 标签: rk3288 串口添加 2017-01-16 14:52 1079 ...
- [RK3288][Android6.0] 调试笔记 --- 软硬键盘同时使用【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/78748313 Platform: RK3288 OS: Android 6.0 Kernel ...
- [RK3288][Android6.0] 调试笔记 --- 测试I2C设备正常传输方法【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/71515020 Platform: RockchipOS: Android 6.0Kernel ...
- [RK3288][Android6.0] 调试笔记 --- eMMC分区号和名字的对应【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/77318410 Platform: Rockchip OS: Android 6.0 Kern ...
- [RK3288][Android6.0] 调试笔记 --- 通用GPIO驱动控制LED【转】
本文转载自:http://m.blog.csdn.net/kris_fei/article/details/69553422 Platform: ROCKCHIPOS: Android 6.0Kern ...
- RK3288][Android6.0] 调试笔记 --- 关闭按键音后无法录音问题【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/70052413 Platform: ROCKCHIPOS: Android 6.0Kernel ...
随机推荐
- 消息队列(message queue)
最近纠结于一个问题,就是horizon 在处理前台数据的时候非得等到cinder client将数据全部获取后才开始执行horizon的下一行代码,这给大量数据显示造成了很大的时延,其实对于用户体验来 ...
- linux下软件的安装与卸载
一 软件安装包的类型 通常Linux应用软件的安装有五种: 1) tar+ gz包,如software-1.2.3-1.tar.gz.他是使用UNIX系统的打包工具tar打包的. 2) r ...
- ST表(离线RMQ)
离线RAQ时,预处理为O(n*lgn),查询为O(1)的算法,比较有意思的一种算法 放个模板在这可以随时看 //ST表(离线) //预处理 O(n*lgn) , 查询 O(1) #include &l ...
- Intellij IDEA工具的常用快捷键
掌握如下常用快捷键可以使自己的开发效率提供十倍. ctrl + B : 转到类或者方法的定义 ctrl + Alt + B:弹出接口/虚类的实现类/子类 ctrl + Alt + 左箭头/右箭头 : ...
- TestClass必须是public的
运行一个测试类遇到一下问题: namespace TestSample.Sample { [TestClass] class CynthiaTest { [Te ...
- git commit -a -m "M 1、引入mixin,公共样式mixin传参处理;";git push origin master:master
<script> import wepy from 'wepy' import api from '../api/api' export default class recharge ex ...
- Time-series Storage Layer Time Series Databases 时间序列
w 关于时间序列数据库的思考-CSDN.NET http://www.csdn.net/article/2015-07-13/2825192 存储和处理时间序列数据(“Time Series Da ...
- JavaScript正则中\1\2的作用
一.示例 1. 验证6个相同的数字 var reg = new RegExp(/^(\d)\1{5}/g); var a = '333333'; if(reg.test(a)) { alert('ri ...
- mysql用户授权以及权限收回
语法 GRANT privileges [(columns)] ON DATABASE.TABLE TO 'username'@'hostname' [IDENTIFIED BY [PASSWORD] ...
- 关于handler内存泄露的问题
在使用Handler更新UI的时候.我是这样写的: public class SampleActivity extends Activity { private final Handler mLeak ...