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

Commit 81786701 authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Add API for putting up locktask pinning toast."

parents 52dbaa08 c21ae9ed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3504,6 +3504,7 @@ package android.app {
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public final deprecated void showDialog(int);
    method public final deprecated boolean showDialog(int, android.os.Bundle);
    method public void showLockTaskEscapeMessage();
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback, int);
    method public void startActivityForResult(android.content.Intent, int);
+1 −0
Original line number Diff line number Diff line
@@ -3588,6 +3588,7 @@ package android.app {
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public final deprecated void showDialog(int);
    method public final deprecated boolean showDialog(int, android.os.Bundle);
    method public void showLockTaskEscapeMessage();
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode startActionMode(android.view.ActionMode.Callback, int);
    method public void startActivityForResult(android.content.Intent, int);
+12 −0
Original line number Diff line number Diff line
@@ -6482,6 +6482,18 @@ public class Activity extends ContextThemeWrapper
        }
    }

    /**
     * Shows the user the system defined message for telling the user how to exit
     * lock task mode. The task containing this activity must be in lock task mode at the time
     * of this call for the message to be displayed.
     */
    public void showLockTaskEscapeMessage() {
        try {
            ActivityManagerNative.getDefault().showLockTaskEscapeMessage(mToken);
        } catch (RemoteException e) {
        }
    }

    /**
     * Interface for informing a translucent {@link Activity} once all visible activities below it
     * have completed drawing. This is necessary only after an {@link Activity} has been made
+21 −0
Original line number Diff line number Diff line
@@ -2345,6 +2345,14 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            return true;
        }

        case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            final IBinder token = data.readStrongBinder();
            showLockTaskEscapeMessage(token);
            reply.writeNoException();
            return true;
        }

        case SET_TASK_DESCRIPTION_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            IBinder token = data.readStrongBinder();
@@ -5551,6 +5559,19 @@ class ActivityManagerProxy implements IActivityManager
        return lockTaskModeState;
    }

    @Override
    public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeStrongBinder(token);
        mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
                IBinder.FLAG_ONEWAY);
        reply.readException();
        data.recycle();
        reply.recycle();
    }

    @Override
    public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
            throws RemoteException {
+3 −0
Original line number Diff line number Diff line
@@ -467,6 +467,8 @@ public interface IActivityManager extends IInterface {

    public int getLockTaskModeState() throws RemoteException;

    public void showLockTaskEscapeMessage(IBinder token) throws RemoteException;

    public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
            throws RemoteException;
    public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException;
@@ -834,4 +836,5 @@ public interface IActivityManager extends IInterface {
    int NOTE_ALARM_START_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+291;
    int NOTE_ALARM_FINISH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+292;
    int GET_PACKAGE_PROCESS_STATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+293;
    int SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+294;
}
Loading