1.0.9 优化管控,增加状态栏管控

This commit is contained in:
2023-10-30 16:23:32 +08:00
parent 8513b3fa6a
commit 60e6316149
5 changed files with 68 additions and 22 deletions

View File

@@ -16,8 +16,8 @@ android {
applicationId "com.uiuipad.find"
minSdkVersion 24
targetSdkVersion 29
versionCode 8
versionName "1.0.7"
versionCode 10
versionName "1.0.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -73,9 +73,25 @@ android {
keyPassword "123456"
v2SigningEnabled false
}
U807UserDebug {
storeFile file("keystore/U807userdebug.keystore")
storePassword "123456"
keyAlias "u807userdebug"
keyPassword "123456"
v2SigningEnabled false
}
}
buildTypes {
U807UserDebug.initWith(release)
U807UserDebug {
buildConfigField "String", "platform", '"U807"'
// versionNameSuffix "-debug"
// debuggable true
signingConfig signingConfigs.U807UserDebug
}
U807Debug.initWith(debug)
U807Debug {
buildConfigField "String", "platform", '"U807"'

Binary file not shown.

View File

@@ -1,14 +1,18 @@
package com.uiuipad.find.util;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.StatusBarManager;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.PowerManager;
import android.provider.Settings;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.uiuipad.find.BuildConfig;
import com.uiuipad.find.bean.kuxin.SnSetting;
@@ -140,8 +144,9 @@ public class ControlUtils {
setBluetooth(context, 0);
setDeveloperOptions(context, 0);
setCanReset(context, 0);
setActionBar(context, 0);
setNavigationBar(context, 0);
setActionBar(context, 1);
// setNavigationBar(context, 0);
setStatusBar(context);
setTF(context, 0);
} else {
int is_storeinstall = snSetting.getIs_storeinstall();
@@ -168,7 +173,8 @@ public class ControlUtils {
setDeveloperOptions(context, 0);
setCanReset(context, 0);
setActionBar(context, 0);
setNavigationBar(context, 0);
// setNavigationBar(context, 0);
setStatusBar(context);
setTF(context, 0);
}
@@ -193,7 +199,8 @@ public class ControlUtils {
}
private static void setBluetooth(Context context, int status) {
boolean aole_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, status);
int code = status == 1 ? 0 : 1;
boolean aole_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, code);
}
@@ -224,9 +231,9 @@ public class ControlUtils {
private static void setCanReset(Context context, int status) {
if (status == 1) {
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
} else {
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1);
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1);
}
Log.e(TAG, "aole_restore_forbid_on:" + status);
}
@@ -236,20 +243,41 @@ public class ControlUtils {
* @param status 系统导航条显示开关
*/
private static void setNavigationBar(Context context, int status) {
boolean aole_hide_NavigationBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, status);
Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar);
String navigationStatus = "";
switch (status) {
case 0:
navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
break;
case 1:
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
break;
default:
// boolean aole_hide_NavigationBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, status);
// Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar);
// String navigationStatus = "";
// switch (status) {
// case 0:
// navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
// break;
// case 1:
// navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
// break;
// default:
// }
// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
// context.sendBroadcast(navIntent);
if (status == 0) {
hideHomeRecent(context);
} else {
setStatusBar(context);
}
Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
context.sendBroadcast(navIntent);
}
@RequiresApi(api = Build.VERSION_CODES.Q)
private static void hideHomeRecent(Context context) {
StatusBarManager statusBarManager = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
int what = StatusBarManager.DISABLE_HOME | StatusBarManager.DISABLE_RECENT;
statusBarManager.disable(what);
}
@SuppressLint("NewApi")
private static void setStatusBar(Context context) {
Log.e(TAG, "setStatusBar: " + "default");
StatusBarManager mStatusBarManager = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
mStatusBarManager.disable(StatusBarManager.DISABLE_BACK | StatusBarManager.DISABLE_RECENT | StatusBarManager.DISABLE_HOME);
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);//显示隐藏的虚拟按键
}
/**
@@ -258,7 +286,7 @@ public class ControlUtils {
*/
private static void setActionBar(Context context, int status) {
Log.e(TAG, "setActionBar: " + status);
Settings.Global.putInt(context.getContentResolver(), "PULLDOWN_MENU_ENABLED", status);
Settings.Global.putInt(context.getContentResolver(), "pulldown_menu_enabled", status);
// int oldNum = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
// if (oldNum != status) {
// boolean aole_hide_statusBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, status);

View File

@@ -11,6 +11,7 @@ android {
}
buildTypes {
U807UserDebug {}
U807Debug {}
U807Release {}
iPlay50SEDebug {}

View File

@@ -13,6 +13,7 @@ android {
}
buildTypes {
U807UserDebug {}
U807Debug {}
U807Release {}
iPlay50SEDebug {}