1.4.0529 第一次联网打开默认桌面,默认桌面不允许退出
This commit is contained in:
@@ -1094,29 +1094,20 @@ public class PushManager {
|
||||
} else {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
|
||||
JsonElement launcherElement = jsonObject.get("default_launcher");
|
||||
if (launcherElement.isJsonNull()) {
|
||||
if (launcherElement.isJsonNull() || TextUtils.isEmpty(launcherElement.getAsString())) {
|
||||
JGYUtils.getInstance().setDefaultDesktop("");
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
||||
JGYUtils.getInstance().openLauncher3();
|
||||
// SPUtils.put(mContext, "default_launcher", "");
|
||||
} else {
|
||||
String default_launcher = launcherElement.getAsString();
|
||||
if (TextUtils.isEmpty(default_launcher)) {
|
||||
JGYUtils.getInstance().setDefaultDesktop("");
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
||||
JGYUtils.getInstance().openLauncher3();
|
||||
// SPUtils.put(mContext, "default_launcher", "");
|
||||
} else {
|
||||
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
||||
ComponentName cn = new ComponentName(default_launcher, JGYUtils.getInstance().getStartClassName(default_launcher));
|
||||
Intent intent = new Intent();
|
||||
intent.setComponent(cn);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
|
||||
// SPUtils.put(mContext, "default_launcher", default_launcher);
|
||||
}
|
||||
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
||||
ComponentName cn = new ComponentName(default_launcher, JGYUtils.getInstance().getStartClassName(default_launcher));
|
||||
Intent intent = new Intent();
|
||||
intent.setComponent(cn);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user