Search in sources :

Example 1 with ContextHubClient

use of android.hardware.location.ContextHubClient in project robolectric by robolectric.

the class ShadowContextHubManagerTest method createClient_returnsValidClient.

@Test
@Config(minSdk = Build.VERSION_CODES.P)
public void createClient_returnsValidClient() {
    ContextHubManager contextHubManager = (ContextHubManager) context.getSystemService(Context.CONTEXTHUB_SERVICE);
    ContextHubClient contextHubClient = contextHubManager.createClient(null, null);
    assertThat(contextHubClient).isNotNull();
}
Also used : ContextHubManager(android.hardware.location.ContextHubManager) ContextHubClient(android.hardware.location.ContextHubClient) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Example 2 with ContextHubClient

use of android.hardware.location.ContextHubClient in project robolectric by robolectric.

the class ShadowContextHubManager method createClient.

@Implementation(minSdk = VERSION_CODES.S)
@HiddenApi
protected Object createClient(Context context, ContextHubInfo hubInfo, PendingIntent pendingIntent, long nanoAppId) {
    ContextHubClient client = Shadow.newInstance(ContextHubClient.class, new Class<?>[] { ContextHubInfo.class, Boolean.TYPE }, new Object[] { hubInfo, false });
    contextHubClientWithPendingIntentList.add(client);
    return client;
}
Also used : ContextHubClient(android.hardware.location.ContextHubClient) HiddenApi(org.robolectric.annotation.HiddenApi) Implementation(org.robolectric.annotation.Implementation)

Aggregations

ContextHubClient (android.hardware.location.ContextHubClient)2 ContextHubManager (android.hardware.location.ContextHubManager)1 Test (org.junit.Test)1 Config (org.robolectric.annotation.Config)1 HiddenApi (org.robolectric.annotation.HiddenApi)1 Implementation (org.robolectric.annotation.Implementation)1