Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2eb185d authored by Louis Chang's avatar Louis Chang
Browse files

Avoid setting the same TaskDescription

...in order to reduce unnecessary IPC calls and overhead.

Bug: 312262682
Test: verified on the market app
Test: atest TaskDescriptionTest
Change-Id: I00d519bf6d4661bbfc3136a222fcb2313461c16b
parent 79d91aa9
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -23,7 +23,9 @@ import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.inMultiWindowMode;
import static android.os.Process.myUid;

import static com.android.sdksandbox.flags.Flags.sandboxActivitySdkBasedContext;

import static java.lang.Character.MIN_VALUE;

import android.annotation.AnimRes;
@@ -7595,7 +7597,10 @@ public class Activity extends ContextThemeWrapper
     * @param taskDescription The TaskDescription properties that describe the task with this activity
     */
    public void setTaskDescription(ActivityManager.TaskDescription taskDescription) {
        if (mTaskDescription != taskDescription) {
        if (taskDescription == null || mTaskDescription.equals(taskDescription)) {
            return;
        }

        mTaskDescription.copyFromPreserveHiddenFields(taskDescription);
        // Scale the icon down to something reasonable if it is provided
        if (taskDescription.getIconFilename() == null && taskDescription.getIcon() != null) {
@@ -7604,7 +7609,6 @@ public class Activity extends ContextThemeWrapper
                    true);
            mTaskDescription.setIcon(Icon.createWithBitmap(icon));
        }
        }
        ActivityClient.getInstance().setTaskDescription(mToken, mTaskDescription);
    }