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

Commit afcd38fe authored by Arthur Ishiguro's avatar Arthur Ishiguro Committed by Matthew Sedam
Browse files

Adds a test API to get the list of preloaded nanoapp

Required to run validation tests to check device capability
needed to run the preloaded nanoapps.

Bug: 258074235
Test: make update-api
Change-Id: Id39d9f0ee3e73bbd00e31fa03a4d626938d49f5a
parent c92cb1eb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1312,6 +1312,14 @@ package android.hardware.lights {

}

package android.hardware.location {

  public final class ContextHubManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public long[] getPreloadedNanoAppIds(@NonNull android.hardware.location.ContextHubInfo);
  }

}

package android.hardware.soundtrigger {

  public class KeyphraseEnrollmentInfo {
+29 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.app.ActivityThread;
import android.app.PendingIntent;
import android.content.Context;
@@ -965,6 +966,34 @@ public final class ContextHubManager {
        return createClient(null /* context */, hubInfo, pendingIntent, nanoAppId);
    }

    /**
     * Queries for the list of preloaded nanoapp IDs on the system.
     *
     * @param hubInfo The Context Hub to query a list of nanoapp IDs from.
     *
     * @return The list of 64-bit IDs of the preloaded nanoapps.
     *
     * @throws NullPointerException if hubInfo is null
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
    @NonNull public long[] getPreloadedNanoAppIds(@NonNull ContextHubInfo hubInfo) {
        Objects.requireNonNull(hubInfo, "hubInfo cannot be null");

        long[] nanoappIds = null;
        try {
            nanoappIds = mService.getPreloadedNanoAppIds(hubInfo);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }

        if (nanoappIds == null) {
            nanoappIds = new long[0];
        }
        return nanoappIds;
    }

    /**
     * Unregister a callback for receive messages from the context hub.
     *