Skip to content

Commit

Permalink
potential fix for latest stable release.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpkarras committed Nov 14, 2023
1 parent 75c650a commit 9a5a97f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdk 30
targetSdk 31
versionCode 1
versionName "1.0.4.2-4"
versionName "1.0.4.2-4-1"
signingConfig signingConfigs.debug
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class DisplayActivity extends AppCompatActivity {
public static DisplayManager displayManager;
public static MediaProjectionManager mediaProjectionManager;
private ActivityOptions activityOptions;
public static Context rearDisplay;
public static boolean isAppInstalled(Context context, String packageName) {
try {
context.getPackageManager().getApplicationInfo(packageName, 0);
Expand All @@ -54,11 +53,10 @@ public void onActivityResult(ActivityResult result) {
break;
}
}
rearDisplay = createDisplayContext(displayManager.getDisplay(rearDisplayId.get()));
activityOptions = activityOptions.makeBasic();
activityOptions.setLaunchDisplayId(rearDisplayId.get());
Intent intent = new Intent(rearDisplay, Mirror.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Intent intent = new Intent(getApplicationContext(), Mirror.class);
intent.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(
intent,
activityOptions.toBundle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public boolean onSurfaceTextureDestroyed(@NonNull SurfaceTexture surfaceTexture)
if(subscreenSwitch == 1) {
Intent intent = new Intent();
intent.setComponent(ComponentName.createRelative("com.xiaomi.misubscreenui", ".SubScreenMainActivity"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
intent.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT|Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
startActivity(intent);
}
return false;
Expand Down

0 comments on commit 9a5a97f

Please sign in to comment.