1、Android7.1禁用锁屏功能

--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
		+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
		@@ -2488,7 +2488,7 @@ class DatabaseHelper extends SQLiteOpenHelper {
		             loadStringSetting(stmt, Settings.Secure.ACCESSIBILITY_SCREEN_READER_URL,
		                     R.string.def_accessibility_screen_reader_url);
		 
		-            if (SystemProperties.getBoolean("ro.lockscreen.disable.default", false) == true) {
		+            if (SystemProperties.getBoolean("ro.lockscreen.disable.default", true) == true) {
		                 loadSetting(stmt, Settings.System.LOCKSCREEN_DISABLED, "1");
		             } else {
		                 loadBooleanSetting(stmt, Settings.System.LOCKSCREEN_DISABLED,

2、Android7.1插入Usb设备启动应用时默认授权

--- a/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
		+++ b/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
		@@ -109,9 +109,15 @@ public class UsbPermissionActivity extends AlertActivity
		         mClearDefaultHint = (TextView)ap.mView.findViewById(
		                                                     com.android.internal.R.id.clearDefaultHint);
		         mClearDefaultHint.setVisibility(View.GONE);
		-
		-        setupAlert();
		-
		+               
		+               //zeni modi usb Dialogs
		+               if(mPackageName.startsWith("com.hoppen.wax.test.testcamera")){
		+                       mPermissionGranted = true;
		+                       finish();
		+               }
		+               else {
		+                       setupAlert(); 
		+               }
		     }

3、Android桌面显示图标大小(显示密度)底部虚拟按键
修改device/rockchip/rk3368/rk3368H_64/system.prop中ro.sf.lcd_density=200
build.prop中加入qemu.hw.mainkeys=1 可以去掉底部虚拟按键

4、插上HDMI电视大概率不显示画面

--- a/drivers/clk/rockchip/clk-rk3368.c
		+++ b/drivers/clk/rockchip/clk-rk3368.c
		@@ -96,6 +96,25 @@ static struct rockchip_pll_rate_table rk3368_pll_rates[] = {
		        { /* sentinel */ },
		 };
		 
		+static struct rockchip_pll_rate_table rk3368_npll_rates[] = {
		+       RK3066_PLL_RATE_NB(594000000, 1, 99, 4, 32),
		+       RK3066_PLL_RATE_NB(585000000, 6, 585, 4, 32),
		+       RK3066_PLL_RATE_NB(432000000, 3, 216, 4, 32),
		+       RK3066_PLL_RATE_NB(426000000, 3, 213, 4, 32),
		+       RK3066_PLL_RATE_NB(400000000, 1, 100, 6, 32),
		+       RK3066_PLL_RATE_NB(342000000, 3, 171, 4, 32),
		+       RK3066_PLL_RATE_NB(297000000, 2, 198, 8, 16),
		+       RK3066_PLL_RATE_NB(270000000, 1, 135, 12, 32),
		+       RK3066_PLL_RATE_NB(260000000, 1, 130, 12, 32),
		+       RK3066_PLL_RATE_NB(148500000, 1, 99, 16, 32),
		+       RK3066_PLL_RATE_NB(146250000, 6, 585, 16, 32),
		+       RK3066_PLL_RATE_NB(108000000, 1, 54, 12, 32),
		+       RK3066_PLL_RATE_NB(106500000, 4, 213, 12, 32),
		+       RK3066_PLL_RATE_NB(85500000, 4, 171, 12, 32),
		+       RK3066_PLL_RATE_NB(74250000, 4, 198, 16, 32),
		+};
		+
		+
		 PNAME(mux_pll_p)               = { "xin24m", "xin32k" };
		 PNAME(mux_armclkb_p)           = { "apllb_core", "gpllb_core" };
		 PNAME(mux_armclkl_p)           = { "aplll_core", "gplll_core" };
		@@ -148,7 +167,7 @@ static struct rockchip_pll_clock rk3368_pll_clks[] __initdata = {
		        [gpll] = PLL(pll_rk3066, PLL_GPLL, "gpll", mux_pll_p, 0, RK3368_PLL_CON(16),
		                     RK3368_PLL_CON(19), 8, 4, ROCKCHIP_PLL_SYNC_RATE, rk3368_pll_rates),
		        [npll] = PLL(pll_rk3066, PLL_NPLL, "npll",  mux_pll_p, 0, RK3368_PLL_CON(20),
		-                    RK3368_PLL_CON(23), 8, 5, 0, rk3368_pll_rates),
		+                    RK3368_PLL_CON(23), 8, 5, 0, rk3368_npll_rates),
		 };
		 
		 static struct clk_div_table div_ddrphy_t[] = {

5、rk3399 Uboot中关机充电(基本上是由于io口不受控引起,使能io口、给电基本上就可以了)

diff --git a/.config b/.config
		index 7f3cc81..20ecf57 100644
		--- a/.config
		+++ b/.config
		@@ -1029,8 +1029,7 @@ CONFIG_POWER_FG_CW201X=y
		 #
		 # IO Domain Support
		 #
		-# CONFIG_IO_DOMAIN is not set
		+CONFIG_IO_DOMAIN=y
		+CONFIG_ROCKCHIP_IO_DOMAIN=y
		 CONFIG_DM_PMIC=y
		 CONFIG_PMIC_CHILDREN=y
		 CONFIG_SPL_PMIC_CHILDREN=y
		diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
		index 870309d..832fccf
		--- a/drivers/power/pmic/rk8xx.c
		+++ b/drivers/power/pmic/rk8xx.c
		@@ -412,7 +412,8 @@ static int rk8xx_probe(struct udevice *dev)
		        uint8_t on_source = 0, off_source = 0;
		        uint8_t power_en0, power_en1, power_en2, power_en3;
		        uint8_t value;
		-
		+       pmic_reg_write(dev, REG_LDO_EN, 173);//使能LDO组电压以使能gpio2
		+       printf("REG_LDO_EN==lxx==0x%x\n",pmic_reg_read(dev, REG_LDO_EN) );
		        /* read Chip variant */
		        if (device_is_compatible(dev, "rockchip,rk817") ||
		            device_is_compatible(dev, "rockchip,rk809")) {
		diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
		index 71f5f1f..dbd7082
		--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
		+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
		@@ -115,7 +115,8 @@ int arch_cpu_init(void)
		 
		        /* Set perilp_nsp QOS priority to 3 for USB 3.0 */
		        writel(QOS_PRIORITY_LEVEL(3, 3), NIU_PERILP_NSP_ADDR);
		-
		+       writel(0xffff0300, PMU_GRF_SOC_CON0);//使能gpio1
		+       printf("==lxx==%d\n",readl(0xff320180));
		        return 0;
		 }

6、默认系统语言为中文

diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
		index 7efe57e..9f9b509 100755
		--- a/tools/buildinfo.sh
		+++ b/tools/buildinfo.sh
		@@ -72,4 +72,9 @@ if [ -n "$BUILD_THUMBPRINT" ] ; then
		 fi
		 echo "ro.build.characteristics=$TARGET_AAPT_CHARACTERISTICS"
		 
		+persist.sys.language=zh
		+persist.sys.country=CN
		+ro.product.locale.language=zh
		+ro.product.locale.region=CN
		+
		 echo "# end build properties"

7、linux全屏显示(去掉上边栏)

weston-3.0.0/clients/desktop-shell.c中做如下修改:永久修改可在“0020-compositor-drm-Support-controlling-output-dynamicall.patch”中加入一下补丁
		@ -1363,9 +1382,9 @ parse_panel_position(struct desktop *desktop, struct weston_config_section *s) {
		char *position;

		- desktop->want_panel = 1;
		+ desktop->want_panel = 0;

		- weston_config_section_get_string(s, "panel-position", &position, "top");
		+ weston_config_section_get_string(s, "panel-position", &position, "none");
		if (strcmp(position, "top") == 0) {
		desktop->panel_position = WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP;
		} else if (strcmp(position, "bottom") == 0) {

8、去掉应添加gslx680.c触摸驱动导致桌面出现鼠标图标

libinput-1.8.2/src/evdev.c中做如下修改:
		diff --git a/evdev.c b/evdev.c
		index ea0ed7a..9121264 100755
		--- a/evdev.c
		+++ b/evdev.c
		@@ -2652,8 +2652,7 @@ evdev_configure_device(struct evdev_device *device)
		                return dispatch;
		        }
		 
		-       if (udev_tags & EVDEV_UDEV_TAG_MOUSE ||
		-           udev_tags & EVDEV_UDEV_TAG_POINTINGSTICK) {
		+       if (udev_tags & EVDEV_UDEV_TAG_POINTINGSTICK) {
		                evdev_tag_external_mouse(device, device->udev_device);
		                evdev_tag_trackpoint(device, device->udev_device);
		                device->dpi = evdev_read_dpi_prop(device);

9、linux开机播放音频不出声:etc/init.d/S50launcher中播放音频前加play指令

printf "Starting launcher: "
        export LC_ALL='zh_CN.utf8'
        export QT_QPA_PLATFORM=wayland
        export WESTON_DRM_MIRROR=1
        export WESTON_DRM_KEEP_RATIO=1
        export QT_GSTREAMER_WINDOW_VIDEOSINK=waylandsink
        mkdir -p /tmp/.xdg &&  chmod 0700 /tmp/.xdg
        export XDG_RUNTIME_DIR=/tmp/.xdg
        weston --tty=2 --idle-time=0&
        play
        sleep 1
        /usr/bin/PionpresueTM_ICP &
        #/usr/bin/QLauncher &

10、默认打开WiFi

diff --git a/packages/SettingsProvider/res/values/defaults.xml 		     			           b/packages/SettingsProvider/res/values/defaults.xml
		index e9bcf2a..aef448d 100755
		--- a/packages/SettingsProvider/res/values/defaults.xml
		+++ b/packages/SettingsProvider/res/values/defaults.xml
		@@ -48,7 +48,7 @@
		     bool name="assisted_gps_enabled">true</bool>
		     bool name="def_netstats_enabled">true</bool>
		     bool name="def_usb_mass_storage_enabled">true</bool>
		-    bool name="def_wifi_on">false</bool>
		+   bool name="def_wifi_on">true</bool>
		     !-- 0 == never, 1 == only when plugged in, 2 == always -->
		     integer name="def_wifi_sleep_policy">2</integer>
		     bool name="def_networks_available_notification_on">true</bool>

11、关于屏闪问题
休眠唤醒后点击切换界面会出现屏闪,通过修改行列的前后尖等参数能改善,还有拔插HDMI会 影响屏的显示,适当抬高屏的频率能有效改善

12、在/sys/目录下创建文件节点

static ssize_t gslX680_show(struct device *dev,
	struct device_attribute *attr, char *buf){

	return sprintf(buf, "%d\n",lxx_data);
}

static ssize_t gslX680_store(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t count){
	
	long open_data;
	int ret;
	int level;
	int ret1;

	ret1 = kstrtoul(buf, 10, &open_data);
	ret=sscanf(buf, "%i", &level);//%i可以把16进制转化为10进制
	lxx_data = (int)open_data;

	if(lxx_data==1){
		gsl_suspend(dev);
	}
	else{
		gsl_resume(dev);
	}
	return count;

}
static DEVICE_ATTR(gslX680_state,  S_IRUGO | S_IWUSR, gslX680_show, gslX680_store);
static struct attribute *gslX680_attributes[] = {
	&dev_attr_gslX680_state.attr,
	NULL,
};

static struct attribute_group ext_test_group = {
     .attrs = gslX680_attributes,
 };

13、设置默认输入法

diff --git a/android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 82a3b13..b4caa2a 100755
--- a/android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -208,4 +208,7 @@
 
     <!-- Default gesture screenrecord enable -->
     <integer name="def_gesture_screenrecord_enable">0</integer>
+
+    <string name="def_input_method" translatable="false">com.sohu.inputmethod.sogouoem/.SogouIME</string>
+    <string name="def_enable_input_methods" translatable="false">jp.co.omronsoft.openwnn/.OpenWnnJAJP:com.android.inputmethod.latin/.LatinIME:com.sohu.inputmethod.sogouoem/.SogouIME</string>
 </resources>
diff --git a/android/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/android/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
old mode 100644
new mode 100755
index 48fbf8e..6ea2998
--- a/android/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/android/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2394,6 +2394,13 @@ class DatabaseHelper extends SQLiteOpenHelper {
 
             loadSecure35Settings(stmt);
 
+            
+            loadStringSetting(stmt, Settings.Secure.ENABLED_INPUT_METHODS,
+                    R.string.def_enable_input_methods);
+
+            loadStringSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD,
+                    R.string.def_input_method);
+
             loadBooleanSetting(stmt, Settings.Secure.MOUNT_PLAY_NOTIFICATION_SND,
                     R.bool.def_mount_play_notification_snd);

14、连WiFi时避过谷歌测试,加快连接速度以及去掉部分WiFi限制

diff --git a/android/frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/android/frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
old mode 100644
new mode 100755
index d3a9354..d3e5434
--- a/android/frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
+++ b/android/frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
@@ -753,6 +753,7 @@ public class NetworkMonitor extends StateMachine {
 
     @VisibleForTesting
     protected CaptivePortalProbeResult isCaptivePortal() {
+       mIsCaptivePortalCheckEnabled = false;
         if (!mIsCaptivePortalCheckEnabled) {
             validationLog("Validation disabled.");
             return CaptivePortalProbeResult.SUCCESS;

15、修改系统版本号

diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index 655418a..7f4a4ad 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -4,7 +4,10 @@ echo "# begin build properties"
 echo "# autogenerated by buildinfo.sh"
 
 echo "ro.build.id=$BUILD_ID"
-echo "ro.build.display.id=$BUILD_DISPLAY_ID"
+#echo "ro.build.display.id=$BUILD_DISPLAY_ID"
+
+echo "ro.build.display.id='v1.0.36s36n62'"
+
 echo "ro.build.version.incremental=$BUILD_NUMBER"
 echo "ro.build.version.sdk=$PLATFORM_SDK_VERSION"
 echo "ro.build.version.preview_sdk=$PLATFORM_PREVIEW_SDK_VERSION"

16、 Android10设置开机默认桌面

--- a/core/java/com/android/internal/app/ResolverActivity.java
		+++ b/core/java/com/android/internal/app/ResolverActivity.java
		@@ -1758,6 +1758,10 @@ public class ResolverActivity extends Activity {
		                     currentResolveList.remove(info);
		                     break;
		                 }
		+                if("com.android.launcher3".equals(info.getResolveInfoAt(0).activityInfo.packageName)){
		+                    currentResolveList.remove(info);
		+                    break;
		+                }
		             }
		 
		             if (mOtherProfile == null) {

17、 Android11设置开机默认桌面

--- a/core/java/com/android/internal/app/ResolverListAdapter.java
		+++ b/core/java/com/android/internal/app/ResolverListAdapter.java
		@@ -239,6 +239,11 @@ public class ResolverListAdapter extends BaseAdapter {
		                 currentResolveList.remove(info);
		                 break;
		             }
		+            
		+            if("com.android.launcher3".equals(info.getResolveInfoAt(0).activityInfo.packageName)){
		+                    currentResolveList.remove(info);
		+                    break;
		+                }
		         }
		 
		         if (mOtherProfile == null) {

18、隐藏顶部导航栏

--- a/core/res/res/values/dimens.xml
		+++ b/core/res/res/values/dimens.xml
		@@ -35,7 +35,7 @@
		     <dimen name="status_bar_height">@dimen/status_bar_height_portrait</dimen>
		     <!-- Height of the status bar in portrait. The height should be
		          Max((status bar content height + waterfall top size), top cutout size) -->
		-    <dimen name="status_bar_height_portrait">24dp</dimen>
		+    <dimen name="status_bar_height_portrait">0dp</dimen>
		     <!-- Height of the status bar in landscape. The height should be
		          Max((status bar content height + waterfall top size), top cutout size) -->
		     <dimen name="status_bar_height_landscape">@dimen/status_bar_height_portrait</dimen>

19、经验证,RC522可实现双天线,且灵敏度与单天线一样。从TX1与TX2出线出并联两路天线回路即可,两路以上尚未验证,猜想也是可以实现。

20、WiFi连接受限,直接跳过校验过程

--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -17,8 +17,9 @@
  */
 -->
 <resources>
+       <integer name="def_captive_portal_mode">0</integer>
     <bool name="def_dim_screen">true</bool>
-    <integer name="def_screen_off_timeout">60000</integer>
+    <integer name="def_screen_off_timeout">2147483647</integer>
     <integer name="def_sleep_timeout">-1</integer>
     <bool name="def_airplane_mode_on">false</bool>
     <bool name="def_theater_mode_on">false</bool>
@@ -82,7 +83,7 @@
     <integer name="def_max_sound_trigger_detection_service_ops_per_day" translatable="false">1000</integer>
     <integer name="def_sound_trigger_detection_service_op_timeout" translatable="false">15000</integer>
 
-    <bool name="def_lockscreen_disabled">false</bool>
+    <bool name="def_lockscreen_disabled">true</bool>
     <bool name="def_device_provisioned">false</bool>
     <integer name="def_dock_audio_media_enabled">1</integer>
 
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
old mode 100644
new mode 100755
index 74d81ccb..e3bb9e11
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2425,6 +2425,9 @@ class DatabaseHelper extends SQLiteOpenHelper {
             stmt = db.compileStatement("INSERT OR IGNORE INTO global(name,value)"
                     + " VALUES(?,?);");
 
+            loadIntegerSetting(stmt, Settings.Global.CAPTIVE_PORTAL_MODE,
+                    R.integer.def_captive_portal_mode);
+
             // --- Previously in 'system'
             loadBooleanSetting(stmt, Settings.Global.AIRPLANE_MODE_ON,
                     R.bool.def_airplane_mode_on);

21、使用第三方apk做桌面应用,不用launcher

--- a/core/java/com/android/internal/app/ResolverListAdapter.java
+++ b/core/java/com/android/internal/app/ResolverListAdapter.java
@@ -239,6 +239,11 @@ public class ResolverListAdapter extends BaseAdapter {
                 currentResolveList.remove(info);
                 break;
             }
+            
+            if("com.android.launcher3".equals(info.getResolveInfoAt(0).activityInfo.packageName)){
+                    currentResolveList.remove(info);
+                    break;
+                }
         }
 
         if (mOtherProfile == null) {

22、kernel屏蔽报错:ccflags-y += -Wno-unused-result。该方法仅限警告性的错误

23、git 常规命令

1、创建并切换到分支:git checkout -b K2_4.4_to_8.1(需建立的分支) master(在该分支上建立)
2、将本地当前分支同步到仓库:git push origin HEAD
3、删除远程仓库分支:git checkout master   先切换到其它分支,git push origin --delete 分支名       然后再删除分支
4、本地分支重命名:git branch -m 原始名称 新名称
5、远程分支重命名:(1)先重命名本地分支 git branch -m 原始名称 新名称
				(2)删除远程分支 git push --delete origin 旧分支名称
				(3)上传新修改名称的本地分支 git push origin 新分支名称
				(4)修改后的本地分支关联远程分支 git branch --set-upstream-to origin/新分支名称