[2.13.0]
[Change] [修复应用身份的配置问题导致Bus无法区分] Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
android:stateNotNeeded="true"
|
||||
android:theme="@style/Main"
|
||||
android:exported="true"
|
||||
android:process=":sub"
|
||||
android:process=":passenger"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||
<!--<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -167,9 +167,8 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
// 启动乘客端Act
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) ||
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
MultiDisplayUtils.INSTANCE.startActWithProcess(
|
||||
MultiDisplayUtils.INSTANCE.startActWithSecond(
|
||||
this,
|
||||
2,
|
||||
PassengerLauncherActivity.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.hardware.display.DisplayManager
|
||||
import android.util.Log
|
||||
import android.view.Display
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
@@ -35,7 +36,18 @@ object MultiDisplayUtils {
|
||||
* @param context
|
||||
* @param launchDisplayId 指定屏幕ID
|
||||
*/
|
||||
fun startActWithProcess(context: Context, launchDisplayId: Int, activity: Class<*>) {
|
||||
fun startActWithSecond(context: Context, activity: Class<*>) {
|
||||
var launchDisplayId = 0;
|
||||
if (isSupportMultiDisplay(context)) {
|
||||
if (getMultiDisplay(context).size > 1) {
|
||||
launchDisplayId = getMultiDisplay(context)[1].displayId
|
||||
} else {
|
||||
Log.e(TAG, "当前没有外接屏幕,只有一个屏幕")
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "当前设备,不支持多个屏幕交互显示")
|
||||
}
|
||||
|
||||
// 要加上Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
val options = ActivityOptions.makeBasic()
|
||||
options.launchDisplayId = launchDisplayId
|
||||
@@ -45,11 +57,11 @@ object MultiDisplayUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 在指定ID的屏幕打开Activity,当前应用的,新开进程启动
|
||||
* 在指定ID的屏幕打开Activity,当前应用的,当前进程
|
||||
* @param context
|
||||
* @param launchDisplayId 指定屏幕ID
|
||||
*/
|
||||
fun startActWithOtherProcess(context: Context, launchDisplayId: Int, activity: Class<*>) {
|
||||
fun startActWithProcess(context: Context, launchDisplayId: Int, activity: Class<*>) {
|
||||
// 要加上Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
val options = ActivityOptions.makeBasic()
|
||||
options.launchDisplayId = launchDisplayId
|
||||
|
||||
Reference in New Issue
Block a user