Merge "Removing explicit target SDK for launcher" into udc-qpr-dev

This commit is contained in:
TreeHugger Robot
2023-06-27 22:34:40 +00:00
committed by Android (Google) Code Review
12 changed files with 58 additions and 17 deletions
@@ -20,7 +20,10 @@ import static android.app.PendingIntent.FLAG_MUTABLE;
import static android.app.PendingIntent.FLAG_ONE_SHOT;
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
import static com.android.launcher3.Utilities.allowBGLaunch;
import android.app.Activity;
import android.app.ActivityOptions;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
import android.content.Context;
@@ -91,9 +94,10 @@ public class StartActivityParams implements Parcelable {
}
public void deliverResult(Context context, int resultCode, Intent data) {
ActivityOptions options = allowBGLaunch(ActivityOptions.makeBasic());
try {
if (mPICallback != null) {
mPICallback.send(context, resultCode, data);
mPICallback.send(context, resultCode, data, null, null, null, options.toBundle());
}
} catch (CanceledException e) {
Log.e(TAG, "Unable to send back result", e);
@@ -579,6 +579,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
Executors.MAIN_EXECUTOR.getHandler(), null,
elapsedRealTime -> callbacks.executeAllAndDestroy());
options.setSplashScreenStyle(splashScreenStyle);
options.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
return new ActivityOptionsWrapper(options, callbacks);
}
@@ -1105,6 +1105,8 @@ public class QuickstepLauncher extends Launcher {
activityOptions.options.setLaunchDisplayId(
(v != null && v.getDisplay() != null) ? v.getDisplay().getDisplayId()
: Display.DEFAULT_DISPLAY);
activityOptions.options.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
addLaunchCookie(item, activityOptions.options);
return activityOptions;
}
@@ -1117,6 +1119,8 @@ public class QuickstepLauncher extends Launcher {
Executors.MAIN_EXECUTOR.getHandler(), null,
elapsedRealTime -> callbacks.executeAllAndDestroy());
options.setSplashScreenStyle(splashScreenStyle);
options.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
return new ActivityOptionsWrapper(options, callbacks);
}
@@ -275,6 +275,8 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> {
activityOptions.options.setLaunchDisplayId(
(v != null && v.getDisplay() != null) ? v.getDisplay().getDisplayId()
: Display.DEFAULT_DISPLAY);
activityOptions.options.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
mHandler.postDelayed(mAnimationStartTimeoutRunnable, RECENTS_ANIMATION_TIMEOUT);
return activityOptions;
}