Class ShadowContextHubManager

    • Constructor Detail

      • ShadowContextHubManager

        public ShadowContextHubManager()
    • Method Detail

      • addNanoApp

        public void addNanoApp​(android.hardware.location.ContextHubInfo info,
                               int nanoAppUid,
                               long nanoAppId,
                               int nanoAppVersion)
        Adds a nanoApp to the list of nanoApps that are supported by the provided contexthubinfo.
      • createInstanceInfo

        public android.hardware.location.NanoAppInstanceInfo createInstanceInfo​(android.hardware.location.ContextHubInfo info,
                                                                                int nanoAppUid,
                                                                                long nanoAppId,
                                                                                int nanoAppVersion)
        Creates and returns a NanoAppInstanceInfo.
      • getContextHubs

        @Implementation(minSdk=28)
        @HiddenApi
        protected List<android.hardware.location.ContextHubInfo> getContextHubs()
        Provides a list with fake ContextHubInfos.

        ContextHubInfo describes an optional physical chip on the device. This does not exist in test; this implementation allows to avoid possible NPEs.

      • getClientsWithAttributionTag

        @Nullable
        public List<android.hardware.location.ContextHubClient> getClientsWithAttributionTag​(String attributionTag)
      • getContextHubClientWithPendingIntentList

        @Nullable
        public List<android.hardware.location.ContextHubClient> getContextHubClientWithPendingIntentList()
      • getContextHubHandles

        @Implementation
        @HiddenApi
        protected int[] getContextHubHandles()
        Provides an array of fake handles.

        These describe an optional physical chip on the device which does not exist during testing. This implementation enables testing of classes that utilize these APIs.

      • getContextHubInfo

        @Implementation
        @HiddenApi
        protected android.hardware.location.ContextHubInfo getContextHubInfo​(int hubHandle)
      • getNanoAppInstanceInfo

        @Implementation
        @HiddenApi
        protected android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo​(int nanoAppHandle)