1.0.9 优化管控,增加状态栏管控
This commit is contained in:
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId "com.uiuipad.find"
|
applicationId "com.uiuipad.find"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 8
|
versionCode 10
|
||||||
versionName "1.0.7"
|
versionName "1.0.9"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -73,9 +73,25 @@ android {
|
|||||||
keyPassword "123456"
|
keyPassword "123456"
|
||||||
v2SigningEnabled false
|
v2SigningEnabled false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
U807UserDebug {
|
||||||
|
storeFile file("keystore/U807userdebug.keystore")
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias "u807userdebug"
|
||||||
|
keyPassword "123456"
|
||||||
|
v2SigningEnabled false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
U807UserDebug.initWith(release)
|
||||||
|
U807UserDebug {
|
||||||
|
buildConfigField "String", "platform", '"U807"'
|
||||||
|
// versionNameSuffix "-debug"
|
||||||
|
// debuggable true
|
||||||
|
signingConfig signingConfigs.U807UserDebug
|
||||||
|
}
|
||||||
|
|
||||||
U807Debug.initWith(debug)
|
U807Debug.initWith(debug)
|
||||||
U807Debug {
|
U807Debug {
|
||||||
buildConfigField "String", "platform", '"U807"'
|
buildConfigField "String", "platform", '"U807"'
|
||||||
|
|||||||
BIN
app/keystore/U807userdebug.keystore
Normal file
BIN
app/keystore/U807userdebug.keystore
Normal file
Binary file not shown.
@@ -1,14 +1,18 @@
|
|||||||
package com.uiuipad.find.util;
|
package com.uiuipad.find.util;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
import android.app.StatusBarManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import com.uiuipad.find.BuildConfig;
|
import com.uiuipad.find.BuildConfig;
|
||||||
import com.uiuipad.find.bean.kuxin.SnSetting;
|
import com.uiuipad.find.bean.kuxin.SnSetting;
|
||||||
@@ -140,8 +144,9 @@ public class ControlUtils {
|
|||||||
setBluetooth(context, 0);
|
setBluetooth(context, 0);
|
||||||
setDeveloperOptions(context, 0);
|
setDeveloperOptions(context, 0);
|
||||||
setCanReset(context, 0);
|
setCanReset(context, 0);
|
||||||
setActionBar(context, 0);
|
setActionBar(context, 1);
|
||||||
setNavigationBar(context, 0);
|
// setNavigationBar(context, 0);
|
||||||
|
setStatusBar(context);
|
||||||
setTF(context, 0);
|
setTF(context, 0);
|
||||||
} else {
|
} else {
|
||||||
int is_storeinstall = snSetting.getIs_storeinstall();
|
int is_storeinstall = snSetting.getIs_storeinstall();
|
||||||
@@ -168,7 +173,8 @@ public class ControlUtils {
|
|||||||
setDeveloperOptions(context, 0);
|
setDeveloperOptions(context, 0);
|
||||||
setCanReset(context, 0);
|
setCanReset(context, 0);
|
||||||
setActionBar(context, 0);
|
setActionBar(context, 0);
|
||||||
setNavigationBar(context, 0);
|
// setNavigationBar(context, 0);
|
||||||
|
setStatusBar(context);
|
||||||
setTF(context, 0);
|
setTF(context, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +199,8 @@ public class ControlUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void setBluetooth(Context context, int status) {
|
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) {
|
private static void setCanReset(Context context, int status) {
|
||||||
if (status == 1) {
|
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 {
|
} 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);
|
Log.e(TAG, "aole_restore_forbid_on:" + status);
|
||||||
}
|
}
|
||||||
@@ -236,20 +243,41 @@ public class ControlUtils {
|
|||||||
* @param status 系统导航条显示开关
|
* @param status 系统导航条显示开关
|
||||||
*/
|
*/
|
||||||
private static void setNavigationBar(Context context, int 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);
|
// 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);
|
// Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar);
|
||||||
String navigationStatus = "";
|
// String navigationStatus = "";
|
||||||
switch (status) {
|
// switch (status) {
|
||||||
case 0:
|
// case 0:
|
||||||
navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
|
// navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
|
||||||
break;
|
// break;
|
||||||
case 1:
|
// case 1:
|
||||||
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
|
// navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
|
||||||
break;
|
// break;
|
||||||
default:
|
// 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) {
|
private static void setActionBar(Context context, int status) {
|
||||||
Log.e(TAG, "setActionBar: " + 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);
|
// int oldNum = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
|
||||||
// if (oldNum != status) {
|
// if (oldNum != status) {
|
||||||
// boolean aole_hide_statusBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, status);
|
// boolean aole_hide_statusBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, status);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
U807UserDebug {}
|
||||||
U807Debug {}
|
U807Debug {}
|
||||||
U807Release {}
|
U807Release {}
|
||||||
iPlay50SEDebug {}
|
iPlay50SEDebug {}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
U807UserDebug {}
|
||||||
U807Debug {}
|
U807Debug {}
|
||||||
U807Release {}
|
U807Release {}
|
||||||
iPlay50SEDebug {}
|
iPlay50SEDebug {}
|
||||||
|
|||||||
Reference in New Issue
Block a user