version:5.4
fix: update:修复不能直接退出桌面,激活设置默认桌面
This commit is contained in:
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId "com.uiui.aios"
|
applicationId "com.uiui.aios"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 44
|
versionCode 45
|
||||||
versionName "5.3"
|
versionName "5.4"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
package="com.uiui.aios"
|
package="com.uiui.aios"
|
||||||
android:sharedUserId="android.uid.system">
|
android:sharedUserId="android.uid.system">
|
||||||
|
|
||||||
|
<queries>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
</intent>
|
||||||
|
</queries>
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
|
||||||
<!-- 清单文件中, 申明监听通话精确状态权限,该权限需要android:sharedUserId="android.uid.system" -->
|
<!-- 清单文件中, 申明监听通话精确状态权限,该权限需要android:sharedUserId="android.uid.system" -->
|
||||||
|
|||||||
@@ -356,6 +356,13 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权");
|
ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权");
|
||||||
gotoNotificationAccessSetting(this);
|
gotoNotificationAccessSetting(this);
|
||||||
}
|
}
|
||||||
|
int is_activation = Settings.Global.getInt(getContentResolver(), "uiui_activation", 0);
|
||||||
|
Log.e(TAG, "onHomePressed: is_activation = " + is_activation);
|
||||||
|
if (is_activation == 1) {
|
||||||
|
LauncherUtils.setDefaultDesktop(MainActivity.this, BuildConfig.APPLICATION_ID, this.getClass().getName());
|
||||||
|
} else {
|
||||||
|
LauncherUtils.setDefaultDesktop(MainActivity.this, LauncherUtils.Launcher3, LauncherUtils.Launcher3Class);
|
||||||
|
}
|
||||||
addData();
|
addData();
|
||||||
mMainPresenter.sendRunningInfo();
|
mMainPresenter.sendRunningInfo();
|
||||||
mMainPresenter.getAdminSnSetting();
|
mMainPresenter.getAdminSnSetting();
|
||||||
|
|||||||
@@ -212,11 +212,11 @@ public class ApkUtils {
|
|||||||
for (ApplicationInfo applicationInfo : infoHashMap.values()) {
|
for (ApplicationInfo applicationInfo : infoHashMap.values()) {
|
||||||
desktopIcons.add(DesktopIcon.creatDesktopIcon(context, applicationInfo));
|
desktopIcons.add(DesktopIcon.creatDesktopIcon(context, applicationInfo));
|
||||||
}
|
}
|
||||||
// DesktopIcon exitIcon = new DesktopIcon();
|
DesktopIcon exitIcon = new DesktopIcon();
|
||||||
// exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
||||||
// exitIcon.setLable("切换系统");
|
exitIcon.setLable("切换系统");
|
||||||
// exitIcon.setPackageName("aios.exit");
|
exitIcon.setPackageName("aios.exit");
|
||||||
// desktopIcons.add(exitIcon);
|
desktopIcons.add(exitIcon);
|
||||||
return desktopIcons;
|
return desktopIcons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ public class LauncherUtils {
|
|||||||
|
|
||||||
public static void openLauncher3(Context context) {
|
public static void openLauncher3(Context context) {
|
||||||
setDefaultDesktop(context, Launcher3, Launcher3Class);
|
setDefaultDesktop(context, Launcher3, Launcher3Class);
|
||||||
// ApkUtils.openPackage(mContext, Launcher3);
|
if (!ApkUtils.openPackage(context, Launcher3)) {
|
||||||
|
setDefaultDesktop(context, Launcher3, Launcher3Class);
|
||||||
gotoLauncher(context);
|
gotoLauncher(context);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void gotoLauncher(Context context) {
|
public static void gotoLauncher(Context context) {
|
||||||
Intent i = new Intent(Intent.ACTION_MAIN);
|
Intent i = new Intent(Intent.ACTION_MAIN);
|
||||||
@@ -33,8 +35,8 @@ public class LauncherUtils {
|
|||||||
context.startActivity(i);
|
context.startActivity(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String Launcher3 = "com.android.launcher3";
|
public static final String Launcher3 = "com.android.launcher3";
|
||||||
private static String Launcher3Class = "com.android.launcher3.Launcher";
|
public static final String Launcher3Class = "com.android.launcher3.Launcher";
|
||||||
|
|
||||||
public static void setDefaultDesktop(Context context, String pkg, String className) {
|
public static void setDefaultDesktop(Context context, String pkg, String className) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
|||||||
Reference in New Issue
Block a user