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

Commit 77670596 authored by Felipe Leme's avatar Felipe Leme
Browse files

Added android.service.contentcapture.ActivityEvent.TYPE_ACTIVITY_STOPPED

Test: atest ChildlessActivityTest#testLaunchAnotherActivity_onTopOfIt
Test: atest CtsContentCaptureServiceTestCases # sanity check

Fixes: 128546985

Change-Id: I98baf8332bec3e75e43a08a6785e5ec77cfb6f7d
parent c5689d35
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6440,6 +6440,7 @@ package android.service.contentcapture {
    field @NonNull public static final android.os.Parcelable.Creator<android.service.contentcapture.ActivityEvent> CREATOR;
    field public static final int TYPE_ACTIVITY_PAUSED = 2; // 0x2
    field public static final int TYPE_ACTIVITY_RESUMED = 1; // 0x1
    field public static final int TYPE_ACTIVITY_STOPPED = 23; // 0x17
  }
  public abstract class ContentCaptureService extends android.app.Service {
+1 −0
Original line number Diff line number Diff line
@@ -2397,6 +2397,7 @@ package android.service.contentcapture {
    field @NonNull public static final android.os.Parcelable.Creator<android.service.contentcapture.ActivityEvent> CREATOR;
    field public static final int TYPE_ACTIVITY_PAUSED = 2; // 0x2
    field public static final int TYPE_ACTIVITY_RESUMED = 1; // 0x1
    field public static final int TYPE_ACTIVITY_STOPPED = 23; // 0x17
  }

  public abstract class ContentCaptureService extends android.app.Service {
+9 −1
Original line number Diff line number Diff line
@@ -47,10 +47,16 @@ public final class ActivityEvent implements Parcelable {
     */
    public static final int TYPE_ACTIVITY_PAUSED = Event.ACTIVITY_PAUSED;

    /**
     * The activity stopped.
     */
    public static final int TYPE_ACTIVITY_STOPPED = Event.ACTIVITY_STOPPED;

    /** @hide */
    @IntDef(prefix = { "TYPE_" }, value = {
            TYPE_ACTIVITY_RESUMED,
            TYPE_ACTIVITY_PAUSED
            TYPE_ACTIVITY_PAUSED,
            TYPE_ACTIVITY_STOPPED
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ActivityEventType{}
@@ -89,6 +95,8 @@ public final class ActivityEvent implements Parcelable {
                return "ACTIVITY_RESUMED";
            case TYPE_ACTIVITY_PAUSED:
                return "ACTIVITY_PAUSED";
            case TYPE_ACTIVITY_STOPPED:
                return "ACTIVITY_STOPPED";
            default:
                return "UKNOWN_TYPE: " + type;
        }
+2 −2
Original line number Diff line number Diff line
@@ -2931,8 +2931,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                        taskRoot);
            }
        }
        if (mContentCaptureService != null
                && (event == Event.ACTIVITY_PAUSED || event == Event.ACTIVITY_RESUMED)) {
        if (mContentCaptureService != null && (event == Event.ACTIVITY_PAUSED
                || event == Event.ACTIVITY_RESUMED || event == Event.ACTIVITY_STOPPED)) {
            mContentCaptureService.notifyActivityEvent(userId, activity, event);
        }
    }