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

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

Merge "Adds missing permission annotation to HubEndpointSession" into main

parents a673bc30 fcbce46f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5264,9 +5264,9 @@ package android.hardware.contexthub {
  }
  @FlaggedApi("android.chre.flags.offload_api") public class HubEndpointSession implements java.lang.AutoCloseable {
    method public void close();
    method @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public void close();
    method @Nullable public android.hardware.contexthub.HubServiceInfo getServiceInfo();
    method @NonNull public android.hardware.location.ContextHubTransaction<java.lang.Void> sendMessage(@NonNull android.hardware.contexthub.HubMessage);
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public android.hardware.location.ContextHubTransaction<java.lang.Void> sendMessage(@NonNull android.hardware.contexthub.HubMessage);
  }
  @FlaggedApi("android.chre.flags.offload_api") public class HubEndpointSessionResult {
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ 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;
@@ -70,6 +71,7 @@ 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.");
@@ -120,6 +122,7 @@ 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();