增加YXPD1机型,增加通过类名打开app

This commit is contained in:
2024-03-08 18:33:41 +08:00
parent d92cf00cba
commit eef0ca2568
4 changed files with 50 additions and 5 deletions

View File

@@ -163,6 +163,20 @@ android {
}
buildTypes {
YXPD1Debug.initWith(debug)
YXPD1Debug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.G10P
buildConfigField "String", "platform", '"YXPD1"'
}
YXPD1Release.initWith(release)
YXPD1Release {
signingConfig signingConfigs.G10P
buildConfigField "String", "platform", '"YXPD1"'
}
c2Debug.initWith(debug)
c2Debug {
versionNameSuffix "-debug"

View File

@@ -13,6 +13,8 @@ android {
}
buildTypes {
YXPD1Debug {}
YXPD1Release {}
c2Debug {}
c2Release {}
G104Debug {}

View File

@@ -75,8 +75,6 @@ import com.alibaba.sdk.android.push.CloudPushService;
import com.alibaba.sdk.android.push.CommonCallback;
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
import com.aoleyun.os.DropTarget.DragObject;
import com.aoleyun.os.uiuiutils.ApkUtils;
import com.aoleyun.os.uiuiutils.Utils;
import com.aoleyun.os.accessibility.LauncherAccessibilityDelegate;
import com.aoleyun.os.allapps.AllAppsContainerView;
import com.aoleyun.os.allapps.AllAppsStore;
@@ -103,10 +101,10 @@ import com.aoleyun.os.logging.UserEventDispatcher;
import com.aoleyun.os.logging.UserEventDispatcher.UserEventDelegate;
import com.aoleyun.os.model.AppLaunchTracker;
import com.aoleyun.os.model.ModelWriter;
import com.aoleyun.os.network.bean.AppPasswdBean;
import com.aoleyun.os.network.bean.BaseResponse;
import com.aoleyun.os.network.HTTPInterface;
import com.aoleyun.os.network.NetInterfaceManager;
import com.aoleyun.os.network.bean.AppPasswdBean;
import com.aoleyun.os.network.bean.BaseResponse;
import com.aoleyun.os.network.bean.NewestAppUpdateResult;
import com.aoleyun.os.notification.NotificationListener;
import com.aoleyun.os.pageindicators.PageIndicatorDots;
@@ -119,8 +117,10 @@ import com.aoleyun.os.states.RotationHelper;
import com.aoleyun.os.testing.TestProtocol;
import com.aoleyun.os.touch.ItemClickHandler;
import com.aoleyun.os.uioverrides.UiFactory;
import com.aoleyun.os.uiuiutils.ApkUtils;
import com.aoleyun.os.uiuiutils.JGYUtils;
import com.aoleyun.os.uiuiutils.TimeUtils;
import com.aoleyun.os.uiuiutils.Utils;
import com.aoleyun.os.userevent.nano.LauncherLogProto;
import com.aoleyun.os.userevent.nano.LauncherLogProto.Action;
import com.aoleyun.os.userevent.nano.LauncherLogProto.ContainerType;
@@ -1281,7 +1281,11 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
/*打开霸屏应用*/
String always_top_packagename = Settings.System.getString(getContentResolver(), "always_top_packagename");
if (!TextUtils.isEmpty(always_top_packagename)) {
ApkUtils.openPackage(Launcher.this, always_top_packagename);
if ("com.tongyi.aistudent".equalsIgnoreCase(always_top_packagename)) {
ApkUtils.openPackage(Launcher.this, "com.tongyi.aistudent", "com.tongyi.aistudent.activity.login.SplashActivity");
} else {
ApkUtils.openPackage(Launcher.this, always_top_packagename);
}
}
mUpdate.checkUpdate(System.currentTimeMillis());
mPasswd.getPassword(System.currentTimeMillis());

View File

@@ -27,6 +27,31 @@ import java.io.OutputStream;
import java.util.List;
public class ApkUtils {
private static final String TAG = ApkUtils.class.getSimpleName();
public static boolean openPackage(Context context, String packageName, String className) {
if (TextUtils.isEmpty(className)) {
return openPackage(context, packageName);
}
ComponentName cn = new ComponentName(packageName, className);
Intent intent = new Intent();
intent.setComponent(cn);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (context != null) {
try {
context.startActivity(intent);
return true;
} catch (Exception e) {
Log.e(TAG, "openPackage: " + e.getMessage());
ToastUtil.show("打开失败");
return false;
}
}
return false;
}
public static boolean openPackage(Context context, String packageName) {
Context pkgContext = getPackageContext(context, packageName);
Intent intent = getAppOpenIntentByPackageName(context, packageName);