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

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

Merge "Initial APIs for Intelligence Service."

parents f4e3113a 1dfa9a01
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -34117,6 +34117,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_INSTALL_APPS = "no_install_apps";
    field public static final java.lang.String DISALLOW_INSTALL_UNKNOWN_SOURCES = "no_install_unknown_sources";
    field public static final java.lang.String DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY = "no_install_unknown_sources_globally";
    field public static final java.lang.String DISALLOW_INTELLIGENCE_CAPTURE = "no_intelligence_capture";
    field public static final java.lang.String DISALLOW_MODIFY_ACCOUNTS = "no_modify_accounts";
    field public static final java.lang.String DISALLOW_MOUNT_PHYSICAL_MEDIA = "no_physical_media";
    field public static final java.lang.String DISALLOW_NETWORK_RESET = "no_network_reset";
@@ -51561,6 +51562,17 @@ 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();
    field public static final int FLAG_USER_INPUT = 1; // 0x1
  }
}
package android.view.textclassifier {
  public final class ConversationActions implements android.os.Parcelable {
+73 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ package android {
    field public static final java.lang.String BIND_DIRECTORY_SEARCH = "android.permission.BIND_DIRECTORY_SEARCH";
    field public static final java.lang.String BIND_EUICC_SERVICE = "android.permission.BIND_EUICC_SERVICE";
    field public static final java.lang.String BIND_IMS_SERVICE = "android.permission.BIND_IMS_SERVICE";
    field public static final java.lang.String BIND_INTELLIGENCE_SERVICE = "android.permission.BIND_INTELLIGENCE_SERVICE";
    field public static final java.lang.String BIND_KEYGUARD_APPWIDGET = "android.permission.BIND_KEYGUARD_APPWIDGET";
    field public static final java.lang.String BIND_NETWORK_RECOMMENDATION_SERVICE = "android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE";
    field public static final java.lang.String BIND_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.BIND_NOTIFICATION_ASSISTANT_SERVICE";
@@ -614,6 +615,14 @@ package android.app.admin {

}

package android.app.assist {

  public static class AssistStructure.ViewNode {
    ctor public AssistStructure.ViewNode();
  }

}

package android.app.backup {

  public class BackupDataInput {
@@ -4861,6 +4870,36 @@ package android.service.euicc {

}

package android.service.intelligence {

  public abstract class IntelligenceService extends android.app.Service {
    ctor public IntelligenceService();
    method public abstract void onContentCaptureEvent(android.service.intelligence.InteractionSessionId, java.util.List<android.view.intelligence.ContentCaptureEvent>);
    method public void onCreateInteractionSession(android.service.intelligence.InteractionContext, android.service.intelligence.InteractionSessionId);
    method public void onDestroyInteractionSession(android.service.intelligence.InteractionSessionId);
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.intelligence.IntelligenceService";
  }

  public final class InteractionContext implements android.os.Parcelable {
    method public int describeContents();
    method public android.content.ComponentName getActivityComponent();
    method public int getDisplayId();
    method public int getFlags();
    method public int getTaskId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.intelligence.InteractionContext> CREATOR;
    field public static final int FLAG_DISABLED_BY_APP = 1; // 0x1
    field public static final int FLAG_DISABLED_BY_FLAG_SECURE = 2; // 0x2
  }

  public final class InteractionSessionId implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.intelligence.InteractionSessionId> CREATOR;
  }

}

package android.service.notification {

  public final class Adjustment implements android.os.Parcelable {
@@ -6898,6 +6937,40 @@ package android.view.accessibility {

}

package android.view.intelligence {

  public final class ContentCaptureEvent implements android.os.Parcelable {
    method public int describeContents();
    method public long getEventTime();
    method public int getFlags();
    method public android.view.autofill.AutofillId getId();
    method public java.lang.CharSequence getText();
    method public int getType();
    method public android.view.intelligence.ViewNode getViewNode();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.intelligence.ContentCaptureEvent> CREATOR;
    field public static final int TYPE_ACTIVITY_PAUSED = 3; // 0x3
    field public static final int TYPE_ACTIVITY_RESUMED = 2; // 0x2
    field public static final int TYPE_ACTIVITY_STARTED = 1; // 0x1
    field public static final int TYPE_ACTIVITY_STOPPED = 4; // 0x4
    field public static final int TYPE_VIEW_ADDED = 5; // 0x5
    field public static final int TYPE_VIEW_REMOVED = 6; // 0x6
    field public static final int TYPE_VIEW_TEXT_CHANGED = 7; // 0x7
  }

  public final class IntelligenceManager {
    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 setPackageContentCaptureEnabled(java.lang.String, boolean);
  }

  public final class ViewNode extends android.app.assist.AssistStructure.ViewNode {
    method public android.view.autofill.AutofillId getParentAutofillId();
  }

}

package android.webkit {

  public abstract class CookieManager {
+6 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ package android.app.assist;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
@@ -713,7 +714,11 @@ public class AssistStructure implements Parcelable {

        ViewNode[] mChildren;

        ViewNode() {
        // TODO(b/111276913): temporarily made public / @hide until we decide what will be used by
        // ScreenObservation.
        /** @hide */
        @SystemApi
        public ViewNode() {
        }

        ViewNode(ParcelTransferReader reader, int nestingLevel) {
+15 −0
Original line number Diff line number Diff line
@@ -935,6 +935,21 @@ public class UserManager {
     */
    public static final String DISALLOW_AUTOFILL = "no_autofill";

    /**
     * Specifies if the contents of a user's screen is not allowed to be captured for artificial
     * intelligence purposes.
     *
     * <p>Device owner and profile owner can set this restriction. When it is set by device owner,
     * only the target user will be affected.
     *
     * <p>The default value is <code>false</code>.
     *
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    public static final String DISALLOW_INTELLIGENCE_CAPTURE = "no_intelligence_capture";

    /**
     * Specifies if user switching is blocked on the current user.
     *
+71 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.service.intelligence;

import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.app.Service;
import android.content.Intent;
import android.view.intelligence.ContentCaptureEvent;

import java.util.List;

/**
 * A service used to captures the content of the screen.
 *
 * <p>The data collected by this service can be analyzed and combined with other sources to provide
 * contextual data in other areas of the system such as Autofill.
 *
 * @hide
 */
@SystemApi
public abstract class IntelligenceService extends Service {

    /**
     * The {@link Intent} that must be declared as handled by the service.
     * To be supported, the service must also require the
     * {@link android.Manifest.permission#BIND_INTELLIGENCE_SERVICE} permission so
     * that other applications can not abuse it.
     */
    public static final String SERVICE_INTERFACE =
            "android.service.intelligence.IntelligenceService";

    /**
     * Creates a new interaction session.
     *
     * @param context interaction context
     * @param sessionId the session's Id
     */
    public void onCreateInteractionSession(@NonNull InteractionContext context,
            @NonNull InteractionSessionId sessionId) {}

    /**
     * Notifies the service of {@link ContentCaptureEvent events} associated with a content capture
     * session.
     *
     * @param sessionId the session's Id
     * @param events the events
     */
    public abstract void onContentCaptureEvent(@NonNull InteractionSessionId sessionId,
            @NonNull List<ContentCaptureEvent> events);

    /**
     * Destroys the content capture session identified by the specified {@code sessionId}.
     *
     * @param sessionId the id of the session to destroy
     */
    public void onDestroyInteractionSession(@NonNull InteractionSessionId sessionId) {}
}
Loading