version:5.4
fix: update:修复不能直接退出桌面,激活设置默认桌面
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
package="com.uiui.aios"
|
||||
android:sharedUserId="android.uid.system">
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<!-- 清单文件中, 申明监听通话精确状态权限,该权限需要android:sharedUserId="android.uid.system" -->
|
||||
|
||||
@@ -356,6 +356,13 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权");
|
||||
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();
|
||||
mMainPresenter.sendRunningInfo();
|
||||
mMainPresenter.getAdminSnSetting();
|
||||
|
||||
@@ -212,11 +212,11 @@ public class ApkUtils {
|
||||
for (ApplicationInfo applicationInfo : infoHashMap.values()) {
|
||||
desktopIcons.add(DesktopIcon.creatDesktopIcon(context, applicationInfo));
|
||||
}
|
||||
// DesktopIcon exitIcon = new DesktopIcon();
|
||||
// exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
||||
// exitIcon.setLable("切换系统");
|
||||
// exitIcon.setPackageName("aios.exit");
|
||||
// desktopIcons.add(exitIcon);
|
||||
DesktopIcon exitIcon = new DesktopIcon();
|
||||
exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
||||
exitIcon.setLable("切换系统");
|
||||
exitIcon.setPackageName("aios.exit");
|
||||
desktopIcons.add(exitIcon);
|
||||
return desktopIcons;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,10 @@ public class LauncherUtils {
|
||||
|
||||
public static void openLauncher3(Context context) {
|
||||
setDefaultDesktop(context, Launcher3, Launcher3Class);
|
||||
// ApkUtils.openPackage(mContext, Launcher3);
|
||||
gotoLauncher(context);
|
||||
if (!ApkUtils.openPackage(context, Launcher3)) {
|
||||
setDefaultDesktop(context, Launcher3, Launcher3Class);
|
||||
gotoLauncher(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static void gotoLauncher(Context context) {
|
||||
@@ -33,8 +35,8 @@ public class LauncherUtils {
|
||||
context.startActivity(i);
|
||||
}
|
||||
|
||||
private static String Launcher3 = "com.android.launcher3";
|
||||
private static String Launcher3Class = "com.android.launcher3.Launcher";
|
||||
public static final String Launcher3 = "com.android.launcher3";
|
||||
public static final String Launcher3Class = "com.android.launcher3.Launcher";
|
||||
|
||||
public static void setDefaultDesktop(Context context, String pkg, String className) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
|
||||
Reference in New Issue
Block a user