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

Commit 2eadd14d authored by Felipe Leme's avatar Felipe Leme Committed by Android (Google) Code Review
Browse files

Merge "Minor changes on IntelligenceManager APIs."

parents 24efb38c 6b3a55c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51827,13 +51827,13 @@ package android.view.inputmethod {
package android.view.intelligence {
  public final class IntelligenceManager {
    method public void disableContentCapture();
    method public android.content.ComponentName getIntelligenceServiceComponentName();
    method public boolean isContentCaptureEnabled();
    method public android.view.ViewStructure newVirtualViewStructure(android.view.autofill.AutofillId, int);
    method public void notifyViewAppeared(android.view.ViewStructure);
    method public void notifyViewDisappeared(android.view.autofill.AutofillId);
    method public void notifyViewTextChanged(android.view.autofill.AutofillId, java.lang.CharSequence, int);
    method public void setContentCaptureEnabled(boolean);
    field public static final int FLAG_USER_INPUT = 1; // 0x1
  }
+1 −0
Original line number Diff line number Diff line
@@ -7058,6 +7058,7 @@ package android.view.intelligence {
    method public java.util.Set<android.content.ComponentName> getContentCaptureDisabledActivities();
    method public java.util.Set<java.lang.String> getContentCaptureDisabledPackages();
    method public void setActivityContentCaptureEnabled(android.content.ComponentName, boolean);
    method public void setContentCaptureWhitelist(java.util.List<java.lang.String>, java.util.List<android.content.ComponentName>);
    method public void setPackageContentCaptureEnabled(java.lang.String, boolean);
  }

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public final class InteractionContext implements Parcelable {
    /**
     * Flag used to indicate that the app explicitly disabled content capture for the activity
     * (using
     * {@link android.view.intelligence.IntelligenceManager#disableContentCapture()}),
     * {@link android.view.intelligence.IntelligenceManager#setContentCaptureEnabled()}),
     * in which case the service will just receive activity-level events.
     */
    public static final int FLAG_DISABLED_BY_APP = 0x1;
+32 −2
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import com.android.internal.util.Preconditions;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
@@ -390,12 +391,12 @@ public final class IntelligenceManager {
    }

    /**
     * Called by apps to disable content capture.
     * Called by apps to explicitly enabled  or disable content capture.
     *
     * <p><b>Note: </b> this call is not persisted accross reboots, so apps should typically call
     * it on {@link android.app.Activity#onCreate(android.os.Bundle, android.os.PersistableBundle)}.
     */
    public void disableContentCapture() {
    public void setContentCaptureEnabled(boolean enabled) {
        //TODO(b/111276913): implement
    }

@@ -418,6 +419,35 @@ public final class IntelligenceManager {
        //TODO(b/111276913): implement
    }

    /**
     * Called by the the service {@link android.service.intelligence.IntelligenceService}
     * to explicitly limit content capture to the given packages and activities.
     *
     * <p>When the whitelist is set, it overrides the values passed to
     * {@link #setActivityContentCaptureEnabled(ComponentName, boolean)}
     * and {@link #setPackageContentCaptureEnabled(String, boolean)}.
     *
     * <p>To reset the whitelist, call it passing {@code null} to both arguments.
     *
     * <p>Useful when the service wants to restrict content capture to a category of apps, like
     * chat apps. For example, if the service wants to support view captures on all activities of
     * app {@code ChatApp1} and just activities {@code act1} and {@code act2} of {@code ChatApp2},
     * it would call: {@code setContentCaptureWhitelist(Arrays.asList("ChatApp1"),
     * Arrays.asList(new ComponentName("ChatApp2", "act1"),
     * new ComponentName("ChatApp2", "act2")));}
     *
     * @throws UnsupportedOperationException if not called by the UID that owns the
     * {@link android.service.intelligence.IntelligenceService} associated with the
     * current user.
     *
     * @hide
     */
    @SystemApi
    public void setContentCaptureWhitelist(@Nullable List<String> packages,
            @Nullable List<ComponentName> activities) {
        //TODO(b/111276913): implement
    }

    /**
     * Called by the the service {@link android.service.intelligence.IntelligenceService}
     * to define whether content capture should be enabled for activities of the app with such