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

Commit 78ead58d authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #22531747: Assist info should declare if user has disabled..." into mnc-dev

parents bde85f74 17f69352
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3466,6 +3466,7 @@ package android.app {
    method public final void setVolumeControlStream(int);
    method public boolean shouldShowRequestPermissionRationale(java.lang.String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
    method public final deprecated void showDialog(int);
    method public final deprecated boolean showDialog(int, android.os.Bundle);
    method public void showLockTaskEscapeMessage();
@@ -28808,6 +28809,7 @@ package android.service.voice {
    method public android.content.Context getContext();
    method public int getDisabledShowContext();
    method public android.view.LayoutInflater getLayoutInflater();
    method public int getUserDisabledShowContext();
    method public android.app.Dialog getWindow();
    method public void hide();
    method public void onAssistStructureFailure(java.lang.Throwable);
@@ -28843,6 +28845,7 @@ package android.service.voice {
    method public void setTheme(int);
    method public void show(android.os.Bundle, int);
    method public void startVoiceActivity(android.content.Intent);
    field public static final int SHOW_SOURCE_APPLICATION = 8; // 0x8
    field public static final int SHOW_SOURCE_ASSIST_GESTURE = 4; // 0x4
    field public static final int SHOW_WITH_ASSIST = 1; // 0x1
    field public static final int SHOW_WITH_SCREENSHOT = 2; // 0x2
+3 −0
Original line number Diff line number Diff line
@@ -3569,6 +3569,7 @@ package android.app {
    method public final void setVolumeControlStream(int);
    method public boolean shouldShowRequestPermissionRationale(java.lang.String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
    method public final deprecated void showDialog(int);
    method public final deprecated boolean showDialog(int, android.os.Bundle);
    method public void showLockTaskEscapeMessage();
@@ -30960,6 +30961,7 @@ package android.service.voice {
    method public android.content.Context getContext();
    method public int getDisabledShowContext();
    method public android.view.LayoutInflater getLayoutInflater();
    method public int getUserDisabledShowContext();
    method public android.app.Dialog getWindow();
    method public void hide();
    method public void onAssistStructureFailure(java.lang.Throwable);
@@ -30995,6 +30997,7 @@ package android.service.voice {
    method public void setTheme(int);
    method public void show(android.os.Bundle, int);
    method public void startVoiceActivity(android.content.Intent);
    field public static final int SHOW_SOURCE_APPLICATION = 8; // 0x8
    field public static final int SHOW_SOURCE_ASSIST_GESTURE = 4; // 0x4
    field public static final int SHOW_WITH_ASSIST = 1; // 0x1
    field public static final int SHOW_WITH_SCREENSHOT = 2; // 0x2
+18 −0
Original line number Diff line number Diff line
@@ -1544,6 +1544,24 @@ public class Activity extends ContextThemeWrapper
    public void onProvideAssistContent(AssistContent outContent) {
    }

    /**
     * Ask to have the current assistant shown to the user.  This only works if the calling
     * activity is the current foreground activity.  It is the same as calling
     * {@link android.service.voice.VoiceInteractionService#showSession
     * VoiceInteractionService.showSession} and requesting all of the possible context.
     * The receiver will always see
     * {@link android.service.voice.VoiceInteractionSession#SHOW_SOURCE_APPLICATION} set.
     * @return Returns true if the assistant was successfully invoked, else false.  For example
     * false will be returned if the caller is not the current top activity.
     */
    public boolean showAssist(Bundle args) {
        try {
            return ActivityManagerNative.getDefault().showAssistFromActivity(mToken, args);
        } catch (RemoteException e) {
        }
        return false;
    }

    /**
     * Called when you are no longer visible to the user.  You will next
     * receive either {@link #onRestart}, {@link #onDestroy}, or nothing,
+1 −1
Original line number Diff line number Diff line
@@ -2807,7 +2807,7 @@ public class ActivityManager {

    /**
     * Request that the system start watching for the calling process to exceed a pss
     * size as given here.  Once called, the system will look for any occassions where it
     * size as given here.  Once called, the system will look for any occasions where it
     * sees the associated process with a larger pss size and, when this happens, automatically
     * pull a heap dump from it and allow the user to share the data.  Note that this request
     * continues running even if the process is killed and restarted.  To remove the watch,
+34 −5
Original line number Diff line number Diff line
@@ -2193,8 +2193,10 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            data.enforceInterface(IActivityManager.descriptor);
            int requestType = data.readInt();
            IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
            requestAssistContextExtras(requestType, receiver);
            IBinder activityToken = data.readStrongBinder();
            boolean res = requestAssistContextExtras(requestType, receiver, activityToken);
            reply.writeNoException();
            reply.writeInt(res ? 1 : 0);
            return true;
        }

@@ -2225,7 +2227,17 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM

        case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            boolean res = isScreenCaptureAllowedOnCurrentActivity();
            boolean res = isAssistDataAllowedOnCurrentActivity();
            reply.writeNoException();
            reply.writeInt(res ? 1 : 0);
            return true;
        }

        case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            IBinder token = data.readStrongBinder();
            Bundle args = data.readBundle();
            boolean res = showAssistFromActivity(token, args);
            reply.writeNoException();
            reply.writeInt(res ? 1 : 0);
            return true;
@@ -5377,17 +5389,20 @@ class ActivityManagerProxy implements IActivityManager
        return res;
    }

    public void requestAssistContextExtras(int requestType, IResultReceiver receiver)
            throws RemoteException {
    public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver,
            IBinder activityToken) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeInt(requestType);
        data.writeStrongBinder(receiver.asBinder());
        data.writeStrongBinder(activityToken);
        mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
        reply.readException();
        boolean res = reply.readInt() != 0;
        data.recycle();
        reply.recycle();
        return res;
    }

    public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
@@ -5429,7 +5444,7 @@ class ActivityManagerProxy implements IActivityManager
        return res;
    }

    public boolean isScreenCaptureAllowedOnCurrentActivity() throws RemoteException {
    public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
@@ -5441,6 +5456,20 @@ class ActivityManagerProxy implements IActivityManager
        return res;
    }

    public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeStrongBinder(token);
        data.writeBundle(args);
        mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0);
        reply.readException();
        boolean res = reply.readInt() != 0;
        data.recycle();
        reply.recycle();
        return res;
    }

    public void killUid(int uid, String reason) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
Loading