add window manager dialog

This commit is contained in:
wangcongtao
2020-05-15 17:00:47 +08:00
parent 696491509c
commit 8d7e09f81d
30 changed files with 455 additions and 1985 deletions

View File

@@ -22,7 +22,9 @@ public class AppLauncher extends BaseAppLauncher {
@Override
public void launch( Context context, AppInfo appInfo ) {
try {
AppServiceHandler.getApis().getAdasControllerApi().closeADAS();
if ( LaunchUtils.getLaunchIntentForPackage( context, appInfo.getPackageName() ) != null ) {
AppServiceHandler.getApis().getAdasControllerApi().closeADAS();
}
LaunchUtils.launchByPkg( context, appInfo.getPackageName() );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );

View File

@@ -20,9 +20,13 @@ public class LaunchUtils {
* @param context
* @param pkg 包名
*/
public static void launchByPkg( Context context, String pkg ) throws Exception{
Intent intent = context.getPackageManager().getLaunchIntentForPackage( pkg );
public static void launchByPkg( Context context, String pkg ) throws Exception {
Intent intent = getLaunchIntentForPackage( context, pkg );
intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
context.startActivity( intent );
}
public static Intent getLaunchIntentForPackage( Context context, String pkg ) {
return context.getPackageManager().getLaunchIntentForPackage( pkg );
}
}