Loading core/java/android/app/ActivityManagerInternal.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.IIntentReceiver; import android.content.IIntentSender; import android.content.IIntentSender; import android.content.Intent; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.ActivityPresentationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.UserInfo; import android.content.pm.UserInfo; import android.os.Bundle; import android.os.Bundle; Loading Loading @@ -247,6 +248,9 @@ public abstract class ActivityManagerInternal { /** Gets the task id for a given activity. */ /** Gets the task id for a given activity. */ public abstract int getTaskIdForActivity(@NonNull IBinder token, boolean onlyRoot); public abstract int getTaskIdForActivity(@NonNull IBinder token, boolean onlyRoot); /** Gets the basic info for a given activity. */ public abstract ActivityPresentationInfo getActivityPresentationInfo(@NonNull IBinder token); public abstract void setBooting(boolean booting); public abstract void setBooting(boolean booting); public abstract boolean isBooting(); public abstract boolean isBooting(); public abstract void setBooted(boolean booted); public abstract void setBooted(boolean booted); Loading core/java/android/content/pm/ActivityPresentationInfo.java 0 → 100644 +39 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 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.content.pm; import android.annotation.NonNull; import android.content.ComponentName; /** * Holds basic information about an activity. * * @hide */ public final class ActivityPresentationInfo { public final int taskId; public final int displayId; @NonNull public final ComponentName componentName; public ActivityPresentationInfo(int taskId, int displayId, @NonNull ComponentName componentName) { this.taskId = taskId; this.displayId = displayId; this.componentName = componentName; } } core/java/android/content/pm/BasicActivityInfo.aidl 0 → 100644 +20 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 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.content.pm; /** @hide */ parcelable BasicActivityInfo; core/java/android/view/contentcapture/ContentCaptureContext.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Bundle; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import android.view.Display; import android.view.View; import android.view.View; import com.android.internal.util.Preconditions; import com.android.internal.util.Preconditions; Loading Loading @@ -90,8 +91,8 @@ public final class ContentCaptureContext implements Parcelable { // Fields below are set by server when the session starts // Fields below are set by server when the session starts private final @Nullable ComponentName mComponentName; private final @Nullable ComponentName mComponentName; private final int mTaskId; private final int mTaskId; private final int mDisplayId; private final int mFlags; private final int mFlags; private final int mDisplayId; // Fields below are set by the service upon "delivery" and are not marshalled in the parcel // Fields below are set by the service upon "delivery" and are not marshalled in the parcel private @Nullable String mParentSessionId; private @Nullable String mParentSessionId; Loading Loading @@ -123,7 +124,8 @@ public final class ContentCaptureContext implements Parcelable { mAction = builder.mAction; mAction = builder.mAction; mComponentName = null; mComponentName = null; mTaskId = mFlags = mDisplayId = 0; mTaskId = mFlags = 0; mDisplayId = Display.INVALID_DISPLAY; } } /** /** Loading services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java +5 −9 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.app.ActivityManagerInternal; import android.content.ComponentName; import android.content.ComponentName; import android.content.ContentResolver; import android.content.ContentResolver; import android.content.Context; import android.content.Context; import android.content.pm.ActivityPresentationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.UserInfo; import android.content.pm.UserInfo; Loading Loading @@ -346,21 +347,16 @@ public final class ContentCaptureManagerService extends @NonNull ComponentName componentName, @NonNull String sessionId, int flags, @NonNull ComponentName componentName, @NonNull String sessionId, int flags, @NonNull IResultReceiver result) { @NonNull IResultReceiver result) { Preconditions.checkNotNull(activityToken); Preconditions.checkNotNull(activityToken); Preconditions.checkNotNull(componentName); Preconditions.checkNotNull(sessionId); Preconditions.checkNotNull(sessionId); final int userId = UserHandle.getCallingUserId(); final int userId = UserHandle.getCallingUserId(); // TODO(b/111276913): refactor getTaskIdForActivity() to also return ComponentName, final ActivityPresentationInfo activityPresentationInfo = getAmInternal() // so we don't pass it on startSession (same for Autofill) .getActivityPresentationInfo(activityToken); final int taskId = getAmInternal().getTaskIdForActivity(activityToken, false); // TODO(b/121260224): get from AM as well final int displayId = 0; synchronized (mLock) { synchronized (mLock) { final ContentCapturePerUserService service = getServiceForUserLocked(userId); final ContentCapturePerUserService service = getServiceForUserLocked(userId); service.startSessionLocked(activityToken, componentName, taskId, displayId, service.startSessionLocked(activityToken, activityPresentationInfo, sessionId, sessionId, Binder.getCallingUid(), flags, result); Binder.getCallingUid(), flags, result); } } } } Loading Loading
core/java/android/app/ActivityManagerInternal.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.IIntentReceiver; import android.content.IIntentSender; import android.content.IIntentSender; import android.content.Intent; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.ActivityPresentationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo; import android.content.pm.UserInfo; import android.content.pm.UserInfo; import android.os.Bundle; import android.os.Bundle; Loading Loading @@ -247,6 +248,9 @@ public abstract class ActivityManagerInternal { /** Gets the task id for a given activity. */ /** Gets the task id for a given activity. */ public abstract int getTaskIdForActivity(@NonNull IBinder token, boolean onlyRoot); public abstract int getTaskIdForActivity(@NonNull IBinder token, boolean onlyRoot); /** Gets the basic info for a given activity. */ public abstract ActivityPresentationInfo getActivityPresentationInfo(@NonNull IBinder token); public abstract void setBooting(boolean booting); public abstract void setBooting(boolean booting); public abstract boolean isBooting(); public abstract boolean isBooting(); public abstract void setBooted(boolean booted); public abstract void setBooted(boolean booted); Loading
core/java/android/content/pm/ActivityPresentationInfo.java 0 → 100644 +39 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 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.content.pm; import android.annotation.NonNull; import android.content.ComponentName; /** * Holds basic information about an activity. * * @hide */ public final class ActivityPresentationInfo { public final int taskId; public final int displayId; @NonNull public final ComponentName componentName; public ActivityPresentationInfo(int taskId, int displayId, @NonNull ComponentName componentName) { this.taskId = taskId; this.displayId = displayId; this.componentName = componentName; } }
core/java/android/content/pm/BasicActivityInfo.aidl 0 → 100644 +20 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 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.content.pm; /** @hide */ parcelable BasicActivityInfo;
core/java/android/view/contentcapture/ContentCaptureContext.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Bundle; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import android.view.Display; import android.view.View; import android.view.View; import com.android.internal.util.Preconditions; import com.android.internal.util.Preconditions; Loading Loading @@ -90,8 +91,8 @@ public final class ContentCaptureContext implements Parcelable { // Fields below are set by server when the session starts // Fields below are set by server when the session starts private final @Nullable ComponentName mComponentName; private final @Nullable ComponentName mComponentName; private final int mTaskId; private final int mTaskId; private final int mDisplayId; private final int mFlags; private final int mFlags; private final int mDisplayId; // Fields below are set by the service upon "delivery" and are not marshalled in the parcel // Fields below are set by the service upon "delivery" and are not marshalled in the parcel private @Nullable String mParentSessionId; private @Nullable String mParentSessionId; Loading Loading @@ -123,7 +124,8 @@ public final class ContentCaptureContext implements Parcelable { mAction = builder.mAction; mAction = builder.mAction; mComponentName = null; mComponentName = null; mTaskId = mFlags = mDisplayId = 0; mTaskId = mFlags = 0; mDisplayId = Display.INVALID_DISPLAY; } } /** /** Loading
services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java +5 −9 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.app.ActivityManagerInternal; import android.content.ComponentName; import android.content.ComponentName; import android.content.ContentResolver; import android.content.ContentResolver; import android.content.Context; import android.content.Context; import android.content.pm.ActivityPresentationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.UserInfo; import android.content.pm.UserInfo; Loading Loading @@ -346,21 +347,16 @@ public final class ContentCaptureManagerService extends @NonNull ComponentName componentName, @NonNull String sessionId, int flags, @NonNull ComponentName componentName, @NonNull String sessionId, int flags, @NonNull IResultReceiver result) { @NonNull IResultReceiver result) { Preconditions.checkNotNull(activityToken); Preconditions.checkNotNull(activityToken); Preconditions.checkNotNull(componentName); Preconditions.checkNotNull(sessionId); Preconditions.checkNotNull(sessionId); final int userId = UserHandle.getCallingUserId(); final int userId = UserHandle.getCallingUserId(); // TODO(b/111276913): refactor getTaskIdForActivity() to also return ComponentName, final ActivityPresentationInfo activityPresentationInfo = getAmInternal() // so we don't pass it on startSession (same for Autofill) .getActivityPresentationInfo(activityToken); final int taskId = getAmInternal().getTaskIdForActivity(activityToken, false); // TODO(b/121260224): get from AM as well final int displayId = 0; synchronized (mLock) { synchronized (mLock) { final ContentCapturePerUserService service = getServiceForUserLocked(userId); final ContentCapturePerUserService service = getServiceForUserLocked(userId); service.startSessionLocked(activityToken, componentName, taskId, displayId, service.startSessionLocked(activityToken, activityPresentationInfo, sessionId, sessionId, Binder.getCallingUid(), flags, result); Binder.getCallingUid(), flags, result); } } } } Loading