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

Commit cd853ec4 authored by Kai Li's avatar Kai Li Committed by Android (Google) Code Review
Browse files

Merge "Add a parameter to requestAssistDataForTask to allow fetching the structure." into main

parents ffb8bc08 102c2297
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ interface IActivityTaskManager {
            in IBinder activityToken, int flags);
    boolean isAssistDataAllowed();
    boolean requestAssistDataForTask(in IAssistDataReceiver receiver, int taskId,
            in String callingPackageName, String callingAttributionTag);
            in String callingPackageName, String callingAttributionTag, boolean fetchStructure);

    /**
     * Notify the system that the keyguard is going away.
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public class AssistContentRequester {
            try {
                boolean success = mActivityTaskManager.requestAssistDataForTask(
                        new AssistDataReceiver(callback, this), taskId, mPackageName,
                        mAttributionTag);
                        mAttributionTag, false /* fetchStructure */);
                if (!success) {
                    callback.onAssistContentAvailable(null);
                }
+16 −2
Original line number Diff line number Diff line
@@ -3144,9 +3144,23 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                null, PENDING_ASSIST_EXTRAS_LONG_TIMEOUT, 0) != null;
    }

    /**
     * Requests assist data for a particular Task.
     *
     * <p>This is used by the system components to request assist data for a Task.
     *
     * @param receiver The receiver to send the assist data to.
     * @param taskId The Task to request assist data for.
     * @param callingPackageName The package name of the caller.
     * @param callingAttributionTag The attribution tag of the caller.
     * @param fetchStructure Whether to fetch the assist structure. Note that this is slow and
     *     should be avoided if possible.
     * @return Whether the request was successful.
     */
    @Override
    public boolean requestAssistDataForTask(IAssistDataReceiver receiver, int taskId,
            String callingPackageName, @Nullable String callingAttributionTag) {
            String callingPackageName, @Nullable String callingAttributionTag,
            boolean fetchStructure) {
        mAmInternal.enforceCallingPermission(android.Manifest.permission.GET_TOP_ACTIVITY_INFO,
                "requestAssistDataForTask()");
        final long callingId = Binder.clearCallingIdentity();
@@ -3171,7 +3185,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        List<IBinder> topActivityToken = new ArrayList<>();
        topActivityToken.add(tokens.getActivityToken());
        requester.requestAssistData(topActivityToken, true /* fetchData */,
                false /* fetchScreenshot */, false /* fetchStructure */, true /* allowFetchData */,
                false /* fetchScreenshot */, fetchStructure, true /* allowFetchData */,
                false /* allowFetchScreenshot*/, true /* ignoreFocusCheck */,
                Binder.getCallingUid(), callingPackageName, callingAttributionTag);