use of android.hardware.location.ContextHubManager in project robolectric by robolectric.
the class ShadowContextHubManagerTest method getContextHubs_returnsValidList.
@Test
@Config(minSdk = Build.VERSION_CODES.P)
public void getContextHubs_returnsValidList() {
ContextHubManager contextHubManager = (ContextHubManager) context.getSystemService(Context.CONTEXTHUB_SERVICE);
List<ContextHubInfo> contextHubInfoList = contextHubManager.getContextHubs();
assertThat(contextHubInfoList).isNotNull();
assertThat(contextHubInfoList).isNotEmpty();
}
use of android.hardware.location.ContextHubManager in project robolectric by robolectric.
the class ShadowContextHubManagerTest method getContextHubInfo_returnsValidInfo.
@Test
public void getContextHubInfo_returnsValidInfo() {
ContextHubManager contextHubManager = (ContextHubManager) context.getSystemService(Context.CONTEXTHUB_SERVICE);
int[] handles = contextHubManager.getContextHubHandles();
assertThat(handles).isNotNull();
for (int handle : handles) {
assertThat(contextHubManager.getContextHubInfo(handle)).isNotNull();
}
}
use of android.hardware.location.ContextHubManager in project robolectric by robolectric.
the class ShadowContextHubManagerTest method getContextHubInfo_returnsInvalidInfo.
@Test
public void getContextHubInfo_returnsInvalidInfo() {
ContextHubManager contextHubManager = (ContextHubManager) context.getSystemService(Context.CONTEXTHUB_SERVICE);
int[] handles = contextHubManager.getContextHubHandles();
assertThat(handles).isNotNull();
assertThat(contextHubManager.getContextHubInfo(-1)).isNull();
assertThat(contextHubManager.getContextHubInfo(handles.length)).isNull();
}
use of android.hardware.location.ContextHubManager in project robolectric by robolectric.
the class ShadowContextHubManagerTest method getNanoAppInstanceInfo_noNanoAppsAdded.
@Test
public void getNanoAppInstanceInfo_noNanoAppsAdded() {
ContextHubManager contextHubManager = context.getSystemService(ContextHubManager.class);
NanoAppInstanceInfo info = contextHubManager.getNanoAppInstanceInfo(0);
assertThat(info).isNull();
}
use of android.hardware.location.ContextHubManager in project robolectric by robolectric.
the class ShadowContextHubManagerTest method getContextHubHandles_returnsValidArray.
@Test
public void getContextHubHandles_returnsValidArray() {
ContextHubManager contextHubManager = (ContextHubManager) context.getSystemService(Context.CONTEXTHUB_SERVICE);
int[] handles = contextHubManager.getContextHubHandles();
assertThat(handles).isNotNull();
assertThat(handles).isNotEmpty();
}
Aggregations