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.ContentProviderAn abstract ContentProvider that implements theHOSContract. 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.
-
-
Constructor Summary
Constructors Constructor Description AbstractHOSProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description android.os.Bundlecall(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.intdelete(android.net.Uri uri, java.lang.String s, java.lang.String[] strings)Not used.protected abstract java.lang.BooleanendNavigation(java.lang.String version)Implement this method to indicate when the app ended navigation.protected abstract HOSContract.HOSStatusgetHOS(java.lang.String version)Implement this method to return the current HOS status.java.lang.StringgetType(android.net.Uri uri)Not used.android.net.Uriinsert(android.net.Uri uri, android.content.ContentValues contentValues)Not used.booleanonCreate()Initialize the provider.android.database.Cursorquery(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.BooleanstartNavigation(java.lang.String version)Implement this method to indicate when the app started navigation.intupdate(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
-
-
-
-
Method Detail
-
onCreate
public boolean onCreate()
Initialize the provider.- Specified by:
onCreatein classandroid.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:
queryin classandroid.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:
getTypein 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:
insertin classandroid.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:
deletein classandroid.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:
updatein classandroid.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:
callin classandroid.content.ContentProvider- Parameters:
method- The desired method to call.version- TheHOSContract.VERSIONextras- Additional data if needed by the method.- Returns:
Bundlewith results.
-
getHOS
protected abstract HOSContract.HOSStatus getHOS(java.lang.String version)
Implement this method to return the current HOS status.- Parameters:
version- TheHOSContract.VERSION- Returns:
- The current HOS
-
startNavigation
protected abstract java.lang.Boolean startNavigation(java.lang.String version)
Implement this method to indicate when the app started navigation.- Parameters:
version- TheHOSContract.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- TheHOSContract.VERSION- Returns:
- Indicator if the method was successful.
-
-