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

Commit cc25a8a2 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Send notification we attempted to start an already running pinned acitvity

API will be used by Android TV sys-ui to decide what to do next with the
Pinned activity.

Bug: 26452296
Change-Id: I5411515d079468616422ba9e5093164a924cd6a2
parent af6a01fb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -23,4 +23,11 @@ oneway interface ITaskStackListener {

    /** Called whenever an Activity is moved to the pinned stack from another stack. */
    void onActivityPinned();

    /**
     * Called whenever IActivityManager.startActivity is called on an activity that is already
     * running in the pinned stack and the activity is not actually started, but the task is either
     * brought to the front or a new Intent is delivered to it.
     */
    void onPinnedActivityRestartAttempt();
}
+4 −0
Original line number Diff line number Diff line
@@ -108,6 +108,10 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements
        public void onActivityPinned() {
        }

        @Override
        public void onPinnedActivityRestartAttempt() {
        }

        /** Preloads the next task */
        public void run() {
            RecentsConfiguration config = Recents.getConfiguration();
+4 −0
Original line number Diff line number Diff line
@@ -104,6 +104,10 @@ public class CarStatusBar extends PhoneStatusBar {
        public void onActivityPinned() {
        }

        @Override
        public void onPinnedActivityRestartAttempt() {
        }

        @Override
        public void onTaskStackChanged() {
            mHandler.removeCallbacks(this);
+4 −0
Original line number Diff line number Diff line
@@ -1108,6 +1108,10 @@ class NavigationBarApps extends LinearLayout
        @Override
        public void onActivityPinned() {
        }

        @Override
        public void onPinnedActivityRestartAttempt() {
        }
    }

    @Override
+4 −2
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.content.res.Resources;
import android.graphics.Rect;
import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.Log;

import java.util.ArrayList;
@@ -38,7 +37,6 @@ import java.util.List;
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;

import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;

/**
@@ -314,6 +312,10 @@ public class PipManager {
            // Post the message back to the UI thread.
            mHandler.post(mOnActivityPinnedRunnable);
        }

        @Override
        public void onPinnedActivityRestartAttempt() {
        }
    }

    /**
Loading