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

Commit a7c37975 authored by Arthur Ishiguro's avatar Arthur Ishiguro
Browse files

Adds AIDL definitions for register/unregisterIntent

Bug: 117612105
Test: Compile only
Change-Id: Ib68110664468afc56a33d3c5069f725014473ee1
parent 5f75c2d1
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -138,8 +138,13 @@ public class ContextHubClient implements Closeable {
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public boolean registerIntent(@NonNull PendingIntent intent, long nanoAppId) {
        // TODO: Implement this
        return false;
        Preconditions.checkNotNull(intent, "PendingIntent cannot be null");

        try {
            return mClientProxy.registerIntent(intent, nanoAppId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
@@ -152,8 +157,13 @@ public class ContextHubClient implements Closeable {
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public boolean unregisterIntent(@NonNull PendingIntent intent) {
        // TODO: Implement this
        return false;
        Preconditions.checkNotNull(intent, "PendingIntent cannot be null");

        try {
            return mClientProxy.unregisterIntent(intent);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
+7 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.hardware.location;

import android.app.PendingIntent;
import android.hardware.location.NanoAppMessage;

/**
@@ -28,4 +29,10 @@ interface IContextHubClient {

    // Closes the connection with the Context Hub
    void close();

    // Registers a PendingIntent with the client
    boolean registerIntent(in PendingIntent intent, long nanoAppId);

    // Unregisters a PendingIntent from the client
    boolean unregisterIntent(in PendingIntent intent);
}
+22 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.location;

import android.app.PendingIntent;
import android.content.Context;
import android.hardware.contexthub.V1_0.ContextHubMsg;
import android.hardware.contexthub.V1_0.IContexthub;
@@ -137,6 +138,27 @@ public class ContextHubClientBroker extends IContextHubClient.Stub
        return ContextHubServiceUtil.toTransactionResult(result);
    }

    /**
     * @param intent the intent to register
     * @param nanoAppId the ID of the nanoapp to send events for
     * @return true on success, false otherwise
     */
    @Override
    public boolean registerIntent(PendingIntent intent, long nanoAppId) {
        // TODO: Implement this
        return false;
    }

    /**
     * @param intent the intent to unregister
     * @return true on success, false otherwise
     */
    @Override
    public boolean unregisterIntent(PendingIntent intent) {
        // TODO: Implement this
        return false;
    }

    /**
     * Closes the connection for this client with the service.
     */