Package org.opencabstandard.provider
Class AbstractHOSProvider
java.lang.Object
android.content.ContentProvider
org.opencabstandard.provider.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 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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionandroid.os.Bundle
This method will be called for all interactions with the ContentProvider based on the method argument passed in.int
Not used.protected abstract Boolean
endNavigation
(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
Implement this method to return the current HOSDataprotected abstract HOSContract.HOSTeamData
protected abstract HOSContract.HOSStatusV2
getHOSV2()
Implement this method to return the current HOS status v2.protected abstract String
Implement this to force a specificHOSContract
.VERSION.protected abstract ArrayList<HOSContract.HOSStatusV2>
Implement this method to return the current team HOS status v2.protected abstract int
Implement this to control how many team drivers will be returned to the consumer app.getType
(android.net.Uri uri) Not used.android.net.Uri
insert
(android.net.Uri uri, android.content.ContentValues contentValues) Not used.protected abstract Boolean
Implement this to enable team driver functionality.boolean
onCreate()
Initialize the provider.android.database.Cursor
Not used.protected abstract Boolean
startNavigation
(String version) Implement this method to indicate when the app started navigation.int
update
(android.net.Uri uri, android.content.ContentValues contentValues, String s, 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
-
Constructor Details
-
AbstractHOSProvider
public AbstractHOSProvider()
-
-
Method Details
-
onCreate
public boolean onCreate()Initialize the provider.- Specified by:
onCreate
in classandroid.content.ContentProvider
- Returns:
- Indicates successful initialization.
-
query
@Nullable public android.database.Cursor query(@NonNull android.net.Uri uri, @Nullable String[] strings, @Nullable String s, @Nullable String[] strings1, @Nullable String s1) Not used.- Specified by:
query
in classandroid.content.ContentProvider
- Parameters:
uri
-strings
-s
-strings1
-s1
-- Returns:
-
getType
Not used.- Specified by:
getType
in classandroid.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 classandroid.content.ContentProvider
- Parameters:
uri
-contentValues
-- Returns:
-
delete
Not used.- Specified by:
delete
in classandroid.content.ContentProvider
- Parameters:
uri
-s
-strings
-- Returns:
-
update
public int update(@NonNull android.net.Uri uri, @Nullable android.content.ContentValues contentValues, @Nullable String s, @Nullable String[] strings) Not used.- Specified by:
update
in classandroid.content.ContentProvider
- Parameters:
uri
-contentValues
-s
-strings
-- Returns:
-
call
@Nullable public android.os.Bundle call(@NonNull String method, @Nullable 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 classandroid.content.ContentProvider
- Parameters:
method
- The desired method to call.version
- TheHOSContract
.VERSIONextras
- Additional data if needed by the method.- Returns:
Bundle
with results.
-
getHOS
Implement this method to return the current HOS status v2.- Returns:
- The current HOS
-
getHOSV2
Implement this method to return the current HOS status v2.- Returns:
- The current HOS
-
getTeamHOSV2
Implement this method to return the current team HOS status v2.- Returns:
- The current HOS
-
getHOSData
Implement this method to return the current HOSData- Returns:
- The current HOS for version 0.4
-
getHOSTeamData
- Returns:
- The current HOS Team Data for version 0.4
-
isTeamDriverEnabled
Implement this to enable team driver functionality.- Returns:
-
getHosVersion
Implement this to force a specificHOSContract
.VERSION.- Returns:
-
getTeamsDriversNumber
protected abstract int getTeamsDriversNumber()Implement this to control how many team drivers will be returned to the consumer app.- Returns:
-