Class AbstractHOSProvider

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.ComponentCallbacks2

    public abstract class AbstractHOSProvider
    extends android.content.ContentProvider
    An abstract ContentProvider that implements the HOSContract. The provider app can choose to implement the full ContentProvider or to extend this class. If extending this class it only needs to implement the abstract methods.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class android.content.ContentProvider

        android.content.ContentProvider.CallingIdentity, android.content.ContentProvider.PipeDataWriter<T extends java.lang.Object>
    • Field Summary

      • Fields inherited from interface android.content.ComponentCallbacks2

        TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      android.os.Bundle call​(java.lang.String method, java.lang.String version, android.os.Bundle extras)
      This method will be called for all interactions with the ContentProvider based on the method argument passed in.
      int delete​(android.net.Uri uri, java.lang.String s, java.lang.String[] strings)
      Not used.
      protected abstract java.lang.Boolean endNavigation​(java.lang.String version)
      Implement this method to indicate when the app ended navigation.
      protected abstract HOSContract.HOSStatus getHOS()
      Implement this method to return the current HOS status v2.
      protected abstract HOSContract.HOSData getHOSData()
      Implement this method to return the current HOSData
      protected abstract HOSContract.HOSTeamData getHOSTeamData()  
      protected abstract HOSContract.HOSStatusV2 getHOSV2()
      Implement this method to return the current HOS status v2.
      protected abstract java.lang.String getHosVersion()
      Implement this to force a specific HOSContract.VERSION.
      protected abstract java.util.ArrayList<HOSContract.HOSStatusV2> getTeamHOSV2()
      Implement this method to return the current team HOS status v2.
      java.lang.String getType​(android.net.Uri uri)
      Not used.
      android.net.Uri insert​(android.net.Uri uri, android.content.ContentValues contentValues)
      Not used.
      protected abstract java.lang.Boolean isTeamDriverEnabled()
      Implement this to enable team driver functionality.
      boolean onCreate()
      Initialize the provider.
      android.database.Cursor query​(android.net.Uri uri, java.lang.String[] strings, java.lang.String s, java.lang.String[] strings1, java.lang.String s1)
      Not used.
      protected abstract java.lang.Boolean startNavigation​(java.lang.String version)
      Implement this method to indicate when the app started navigation.
      int update​(android.net.Uri uri, android.content.ContentValues contentValues, java.lang.String s, java.lang.String[] strings)
      Not used.
      • Methods inherited from class android.content.ContentProvider

        applyBatch, applyBatch, attachInfo, bulkInsert, call, canonicalize, clearCallingIdentity, delete, dump, getCallingAttributionSource, getCallingAttributionTag, getCallingPackage, getCallingPackageUnchecked, getContext, getPathPermissions, getReadPermission, getStreamTypes, getWritePermission, insert, isTemporary, onCallingPackageChanged, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openAssetFile, openFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, query, refresh, requireContext, restoreCallingIdentity, setPathPermissions, setReadPermission, setWritePermission, shutdown, uncanonicalize, update
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractHOSProvider

        public AbstractHOSProvider()
    • Method Detail

      • onCreate

        public boolean onCreate()
        Initialize the provider.
        Specified by:
        onCreate in class android.content.ContentProvider
        Returns:
        Indicates successful initialization.
      • query

        @Nullable
        public android.database.Cursor query​(@NonNull
                                             android.net.Uri uri,
                                             @Nullable
                                             java.lang.String[] strings,
                                             @Nullable
                                             java.lang.String s,
                                             @Nullable
                                             java.lang.String[] strings1,
                                             @Nullable
                                             java.lang.String s1)
        Not used.
        Specified by:
        query in class android.content.ContentProvider
        Parameters:
        uri -
        strings -
        s -
        strings1 -
        s1 -
        Returns:
      • getType

        @Nullable
        public java.lang.String getType​(@NonNull
                                        android.net.Uri uri)
        Not used.
        Specified by:
        getType in class android.content.ContentProvider
        Parameters:
        uri -
        Returns:
      • insert

        @Nullable
        public android.net.Uri insert​(@NonNull
                                      android.net.Uri uri,
                                      @Nullable
                                      android.content.ContentValues contentValues)
        Not used.
        Specified by:
        insert in class android.content.ContentProvider
        Parameters:
        uri -
        contentValues -
        Returns:
      • delete

        public int delete​(@NonNull
                          android.net.Uri uri,
                          @Nullable
                          java.lang.String s,
                          @Nullable
                          java.lang.String[] strings)
        Not used.
        Specified by:
        delete in class android.content.ContentProvider
        Parameters:
        uri -
        s -
        strings -
        Returns:
      • update

        public int update​(@NonNull
                          android.net.Uri uri,
                          @Nullable
                          android.content.ContentValues contentValues,
                          @Nullable
                          java.lang.String s,
                          @Nullable
                          java.lang.String[] strings)
        Not used.
        Specified by:
        update in class android.content.ContentProvider
        Parameters:
        uri -
        contentValues -
        s -
        strings -
        Returns:
      • call

        @Nullable
        public android.os.Bundle call​(@NonNull
                                      java.lang.String method,
                                      @Nullable
                                      java.lang.String version,
                                      @Nullable
                                      android.os.Bundle extras)
        This method will be called for all interactions with the ContentProvider based on the method argument passed in. The appropriate abstract method will be called based on the method argument.
        Overrides:
        call in class android.content.ContentProvider
        Parameters:
        method - The desired method to call.
        version - The HOSContract.VERSION
        extras - Additional data if needed by the method.
        Returns:
        Bundle with results.
      • getHOS

        protected abstract HOSContract.HOSStatus getHOS()
        Implement this method to return the current HOS status v2.
        Returns:
        The current HOS
      • getHOSV2

        protected abstract HOSContract.HOSStatusV2 getHOSV2()
        Implement this method to return the current HOS status v2.
        Returns:
        The current HOS
      • getTeamHOSV2

        protected abstract java.util.ArrayList<HOSContract.HOSStatusV2> getTeamHOSV2()
        Implement this method to return the current team HOS status v2.
        Returns:
        The current HOS
      • getHOSData

        protected abstract HOSContract.HOSData getHOSData()
        Implement this method to return the current HOSData
        Returns:
        The current HOS for version 0.4
      • getHOSTeamData

        protected abstract HOSContract.HOSTeamData getHOSTeamData()
        Returns:
        The current HOS Team Data for version 0.4
      • startNavigation

        protected abstract java.lang.Boolean startNavigation​(java.lang.String version)
        Implement this method to indicate when the app started navigation.
        Parameters:
        version - The HOSContract.VERSION
        Returns:
        Indicator if the method was successful.
      • endNavigation

        protected abstract java.lang.Boolean endNavigation​(java.lang.String version)
        Implement this method to indicate when the app ended navigation.
        Parameters:
        version - The HOSContract.VERSION
        Returns:
        Indicator if the method was successful.
      • isTeamDriverEnabled

        protected abstract java.lang.Boolean isTeamDriverEnabled()
        Implement this to enable team driver functionality.
        Returns:
      • getHosVersion

        protected abstract java.lang.String getHosVersion()
        Implement this to force a specific HOSContract.VERSION.
        Returns: