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

Commit 11f742ec authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Adds missing permission annotation to HubEndpointSession"" into main

parents 3cf71b7e 86f34426
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5254,9 +5254,9 @@ package android.hardware.contexthub {
  }
  @FlaggedApi("android.chre.flags.offload_api") public class HubEndpointSession implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public void close();
    method public void close();
    method @Nullable public android.hardware.contexthub.HubServiceInfo getServiceInfo();
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public android.hardware.location.ContextHubTransaction<java.lang.Void> sendMessage(@NonNull android.hardware.contexthub.HubMessage);
    method @NonNull public android.hardware.location.ContextHubTransaction<java.lang.Void> sendMessage(@NonNull android.hardware.contexthub.HubMessage);
  }
  @FlaggedApi("android.chre.flags.offload_api") public class HubEndpointSessionResult {
+0 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.hardware.contexthub;
import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.chre.flags.Flags;
import android.hardware.location.ContextHubTransaction;
@@ -71,7 +70,6 @@ public class HubEndpointSession implements AutoCloseable {
     *     receiving the response for the message.
     */
    @NonNull
    @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
    public ContextHubTransaction<Void> sendMessage(@NonNull HubMessage message) {
        if (mIsClosed.get()) {
            throw new IllegalStateException("Session is already closed.");
@@ -122,7 +120,6 @@ public class HubEndpointSession implements AutoCloseable {
     * <p>When this function is invoked, the messaging associated with this session is invalidated.
     * All futures messages targeted for this client are dropped.
     */
    @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
    public void close() {
        if (!mIsClosed.getAndSet(true)) {
            mCloseGuard.close();
+0 −6
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ interface IContextHubEndpoint {
     * @throws IllegalArgumentException If the HubEndpointInfo is not valid.
     * @throws IllegalStateException If there are too many opened sessions.
     */
    @EnforcePermission("ACCESS_CONTEXT_HUB")
    int openSession(in HubEndpointInfo destination, in @nullable HubServiceInfo serviceInfo);

    /**
@@ -49,7 +48,6 @@ interface IContextHubEndpoint {
     *
     * @throws IllegalStateException If the session wasn't opened.
     */
    @EnforcePermission("ACCESS_CONTEXT_HUB")
    void closeSession(int sessionId, int reason);

    /**
@@ -61,13 +59,11 @@ interface IContextHubEndpoint {
     *
     * @throws IllegalStateException If the session wasn't opened.
     */
    @EnforcePermission("ACCESS_CONTEXT_HUB")
    void openSessionRequestComplete(int sessionId);

    /**
     * Unregister this endpoint from the HAL, invalidate the EndpointInfo previously assigned.
     */
    @EnforcePermission("ACCESS_CONTEXT_HUB")
    void unregister();

    /**
@@ -79,7 +75,6 @@ interface IContextHubEndpoint {
     * @param transactionCallback Nullable. If the hub message requires a reply, the transactionCallback
     *                            will be set to non-null.
     */
    @EnforcePermission("ACCESS_CONTEXT_HUB")
    void sendMessage(int sessionId, in HubMessage message,
                     in @nullable IContextHubTransactionCallback transactionCallback);

@@ -91,6 +86,5 @@ interface IContextHubEndpoint {
     * @param messageSeqNumber The message sequence number, this should match a previously received HubMessage.
     * @param errorCode The message delivery status detail.
     */
    @EnforcePermission("ACCESS_CONTEXT_HUB")
    void sendMessageDeliveryStatus(int sessionId, int messageSeqNumber, byte errorCode);
}