系统常见修改:
去除系统锁屏:
frameworks/base
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
old mode 100644
new mode 100755
index 761d8bcbed00..227d5e1c1dbb
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -82,7 +82,7 @@
1000
15000
- false
+ true
设置默认语言为中文:
build/target/product/full_base.mk
PRODUCT_LOCALES := zh_CN
修改默认休眠时间:
frameworks\base\packages\SettingsProvider\res\values\defaults.xml
60000
修改默认亮度:
frameworks\base\packages\SettingsProvider\res\values\defaults.xml 或者
common/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
102
默认关闭提示音:
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index a7ec5a3ea3f6..e2a65a1878bf 100755
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -136,7 +136,7 @@
true
- true
+ false
默认时区:
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 72ebc90670dd..2df468a468e8 100755
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -453,7 +453,7 @@ public final class SystemServer {
String timezoneProperty = SystemProperties.get("persist.sys.timezone");
if (timezoneProperty == null || timezoneProperty.isEmpty()) {
Slog.w(TAG, "Timezone not set; setting to GMT.");
- SystemProperties.set("persist.sys.timezone", "GMT");
+ SystemProperties.set("persist.sys.timezone", "Asia/Shanghai");
}
默认时制,设置为24小时:
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 21a0da4e02fb..3d70e9ff5677 100755
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -62,6 +62,9 @@
true
true
+
+ 24
+
1
/product/media/audio/ui/LowBattery.ogg
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index b9964339d7a8..4b58c7ec39a4 100755
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2253,6 +2253,9 @@ class DatabaseHelper extends SQLiteOpenHelper {
// Set default tty mode
loadSetting(stmt, Settings.System.TTY_MODE, 0);
+ // set 24time
+ loadStringSetting(stmt, Settings.System.TIME_12_24,R.string.def_time_12_24);
+
loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS,
R.integer.def_screen_brightness);
关闭SElinux:
--- a/init/selinux.cpp
+++ b/init/selinux.cpp
@@ -476,6 +476,7 @@ void SelinuxInitialize() {
bool kernel_enforcing = (security_getenforce() == 1);
bool is_enforcing = IsEnforcing();
+ is_enforcing = 0;
if (kernel_enforcing != is_enforcing) {
if (security_setenforce(is_enforcing)) {
去除搜索框:
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
old mode 100644
new mode 100755
index b23cce921..d4a65f05b
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -52,7 +52,7 @@ public final class FeatureFlags {
* Enable moving the QSB on the 0th screen of the workspace. This is not a configuration feature
* and should be modified at a project level.
*/
- public static final boolean QSB_ON_FIRST_SCREEN = !Utilities.isEinkProduct();
+ public static final boolean QSB_ON_FIRST_SCREEN = false;
允许APP安装第三方应用:
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
index 5675c9986ac..1a6b3567a41
--- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -464,7 +464,7 @@ public class PackageInstallerActivity extends AlertActivity {
private void handleUnknownSources() {
if (mOriginatingPackage == null) {
Log.i(TAG, "No source found for package " + mPkgInfo.packageName);
- showDialogInner(DLG_ANONYMOUS_SOURCE);
+ initiateInstall();
return;
}
// Shouldn't use static constant directly, see b/65534401.
@@ -474,11 +474,10 @@ public class PackageInstallerActivity extends AlertActivity {
mOriginatingUid, mOriginatingPackage);
switch (appOpMode) {
case AppOpsManager.MODE_DEFAULT:
- mAppOpsManager.setMode(appOpCode, mOriginatingUid,
- mOriginatingPackage, AppOpsManager.MODE_ERRORED);
+ initiateInstall();
// fall through
case AppOpsManager.MODE_ERRORED:
- showDialogInner(DLG_EXTERNAL_SOURCE_BLOCKED);
+ initiateInstall();
break;
case AppOpsManager.MODE_ALLOWED:
initiateInstall();
网络adb
adb tcpip 5555 (端口号)
adb connect 192.168.1.199 (Android设备IP地址)
去除Launcher3 Home属性:
diff --git a/quickstep/AndroidManifest-launcher.xml b/quickstep/AndroidManifest-launcher.xml
index 60afddb0a..467bd9a62 100644
--- a/quickstep/AndroidManifest-launcher.xml
+++ b/quickstep/AndroidManifest-launcher.xml
@@ -56,7 +56,6 @@
android:enabled="true">
-
diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
old mode 100644
new mode 100755
index 07f838b1b..c6a01cca6
--- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
+++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
@@ -74,12 +74,13 @@ public final class OverviewComponentObserver {
mContext = context;
mDeviceState = deviceState;
mCurrentHomeIntent = new Intent(Intent.ACTION_MAIN)
- .addCategory(Intent.CATEGORY_HOME)
+ // .addCategory(Intent.CATEGORY_HOME)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mMyHomeIntent = new Intent(mCurrentHomeIntent).setPackage(mContext.getPackageName());
ResolveInfo info = context.getPackageManager().resolveActivity(mMyHomeIntent, 0);
ComponentName myHomeComponent =
- new ComponentName(context.getPackageName(), info.activityInfo.name);
+ // new ComponentName(context.getPackageName(), info.activityInfo.name);
+ new ComponentName("com.android.launcher3", "com.android.launcher3.Launcher");
mMyHomeIntent.setComponent(myHomeComponent);
mConfigChangesMap.append(myHomeComponent.hashCode(), info.activityInfo.configChanges);
背光调节不均匀补丁:
diff --git a/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
old mode 100644
new mode 100755
index 4f86afaa995c..3bdca0da1bf6
--- a/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
@@ -29,6 +29,8 @@ public class BrightnessUtils {
private static final float B = 0.28466892f;
private static final float C = 0.55991073f;
+ private static final boolean USE_LINEAR = true;
+
/**
* A function for converting from the gamma space that the slider works in to the
* linear space that the setting works in.
@@ -75,6 +77,10 @@ public class BrightnessUtils {
* @return The corresponding setting value.
*/
public static final float convertGammaToLinearFloat(int val, float min, float max) {
+ if(USE_LINEAR){
+ float result = (float)val / 65535;
+ return result;
+ }
final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val);
final float ret;
if (normalizedVal <= R) {
@@ -127,6 +133,22 @@ public class BrightnessUtils {
* @return The corresponding slider value
*/
public static final int convertLinearToGammaFloat(float val, float min, float max) {
+ if (USE_LINEAR) {
+ if (min < 0) {
+ min = 0;
+ }
+ if (max <= 0) {
+ return GAMMA_SPACE_MAX/2;
+ }
+ if (val <= min) {
+ return 0;
+ }
+ if (val >= max) {
+ return GAMMA_SPACE_MAX;
+ }
+ int result = (int)((val-min)*GAMMA_SPACE_MAX/(max-min));
+ return result;
+ }
// For some reason, HLG normalizes to the range [0, 12] rather than [0, 1]
final float normalizedVal = MathUtils.norm(min, max, val) * 12;
final float ret;