Loading core/java/android/view/textclassifier/SelectionEvent.java +9 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,15 @@ public final class SelectionEvent implements Parcelable { return mPackageName; } /** * Sets the id of this event's user. * <p> * Package-private for SystemTextClassifier's use. */ void setUserId(@UserIdInt int userId) { mUserId = userId; } /** * Returns the id of this event's user. * @hide Loading core/java/android/view/textclassifier/SystemTextClassifier.java +7 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ public final class SystemTextClassifier implements TextClassifier { Utils.checkMainThread(); try { event.setUserId(mUserId); mManagerService.onSelectionEvent(mSessionId, event); } catch (RemoteException e) { Log.e(LOG_TAG, "Error reporting selection event.", e); Loading @@ -163,6 +164,12 @@ public final class SystemTextClassifier implements TextClassifier { Utils.checkMainThread(); try { final TextClassificationContext tcContext = event.getEventContext() == null ? new TextClassificationContext.Builder(mPackageName, WIDGET_TYPE_UNKNOWN) .build() : event.getEventContext(); tcContext.setUserId(mUserId); event.setEventContext(tcContext); mManagerService.onTextClassifierEvent(mSessionId, event); } catch (RemoteException e) { Log.e(LOG_TAG, "Error reporting textclassifier event.", e); Loading core/java/android/view/textclassifier/TextClassifierEvent.java +10 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public abstract class TextClassifierEvent implements Parcelable { @Nullable private final String[] mEntityTypes; @Nullable private final TextClassificationContext mEventContext; private TextClassificationContext mEventContext; @Nullable private final String mResultId; private final int mEventIndex; Loading Loading @@ -288,6 +288,15 @@ public abstract class TextClassifierEvent implements Parcelable { return mEventContext; } /** * Sets the event context. * <p> * Package-private for SystemTextClassifier's use. */ void setEventContext(@Nullable TextClassificationContext eventContext) { mEventContext = eventContext; } /** * Returns the id of the text classifier result related to this event. */ Loading services/core/java/com/android/server/textclassifier/TextClassificationManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -457,12 +457,12 @@ public final class TextClassificationManagerService extends ITextClassifierServi Preconditions.checkArgument(userId != UserHandle.USER_NULL, "Null userId"); final int callingUserId = UserHandle.getCallingUserId(); if (callingUserId != userId) { context.enforceCallingPermission( context.enforceCallingOrSelfPermission( android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, "Invalid userId. UserId=" + userId + ", CallingUserId=" + callingUserId); } } catch (Exception e) { throw new RemoteException("Invalid request", e, throw new RemoteException("Invalid request: " + e.getMessage(), e, /* enableSuppression */ true, /* writableStackTrace */ true); } } Loading Loading
core/java/android/view/textclassifier/SelectionEvent.java +9 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,15 @@ public final class SelectionEvent implements Parcelable { return mPackageName; } /** * Sets the id of this event's user. * <p> * Package-private for SystemTextClassifier's use. */ void setUserId(@UserIdInt int userId) { mUserId = userId; } /** * Returns the id of this event's user. * @hide Loading
core/java/android/view/textclassifier/SystemTextClassifier.java +7 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ public final class SystemTextClassifier implements TextClassifier { Utils.checkMainThread(); try { event.setUserId(mUserId); mManagerService.onSelectionEvent(mSessionId, event); } catch (RemoteException e) { Log.e(LOG_TAG, "Error reporting selection event.", e); Loading @@ -163,6 +164,12 @@ public final class SystemTextClassifier implements TextClassifier { Utils.checkMainThread(); try { final TextClassificationContext tcContext = event.getEventContext() == null ? new TextClassificationContext.Builder(mPackageName, WIDGET_TYPE_UNKNOWN) .build() : event.getEventContext(); tcContext.setUserId(mUserId); event.setEventContext(tcContext); mManagerService.onTextClassifierEvent(mSessionId, event); } catch (RemoteException e) { Log.e(LOG_TAG, "Error reporting textclassifier event.", e); Loading
core/java/android/view/textclassifier/TextClassifierEvent.java +10 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public abstract class TextClassifierEvent implements Parcelable { @Nullable private final String[] mEntityTypes; @Nullable private final TextClassificationContext mEventContext; private TextClassificationContext mEventContext; @Nullable private final String mResultId; private final int mEventIndex; Loading Loading @@ -288,6 +288,15 @@ public abstract class TextClassifierEvent implements Parcelable { return mEventContext; } /** * Sets the event context. * <p> * Package-private for SystemTextClassifier's use. */ void setEventContext(@Nullable TextClassificationContext eventContext) { mEventContext = eventContext; } /** * Returns the id of the text classifier result related to this event. */ Loading
services/core/java/com/android/server/textclassifier/TextClassificationManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -457,12 +457,12 @@ public final class TextClassificationManagerService extends ITextClassifierServi Preconditions.checkArgument(userId != UserHandle.USER_NULL, "Null userId"); final int callingUserId = UserHandle.getCallingUserId(); if (callingUserId != userId) { context.enforceCallingPermission( context.enforceCallingOrSelfPermission( android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, "Invalid userId. UserId=" + userId + ", CallingUserId=" + callingUserId); } } catch (Exception e) { throw new RemoteException("Invalid request", e, throw new RemoteException("Invalid request: " + e.getMessage(), e, /* enableSuppression */ true, /* writableStackTrace */ true); } } Loading