-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.ComponentCallbacks2
public final class HolochainService extends Service
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classHolochainService.Companion
-
Constructor Summary
Constructors Constructor Description HolochainService()
-
Method Summary
Modifier and Type Method Description IntegeronStartCommand(Intent intent, Integer flags, Integer startId)Called by the system when the service is first created or when an intent is delivered to the service. UnitonDestroy()IBinderonBind(Intent intent)Called when a client binds to the service with bindService(). final UnitstopForeground()Stops the foreground service and shuts down the Holochain conductor. -
Methods inherited from class org.holochain.androidserviceruntime.service.HolochainService
attachBaseContext, dump, getApplication, getForegroundServiceType, onConfigurationChanged, onCreate, onLowMemory, onRebind, onStart, onTaskRemoved, onTimeout, onTrimMemory, onUnbind, startForeground, startForeground, stopForeground, stopForeground, stopSelf, stopSelf, stopSelfResult -
Methods inherited from class android.app.Service
bindIsolatedService, bindService, bindService, bindService, bindService, bindServiceAsUser, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDeviceId, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getResources, getSharedPreferences, getSystemService, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerComponentCallbacks, registerDeviceIdChangeListener, registerReceiver, registerReceiver, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionsOnKill, revokeUriPermission, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startForegroundService, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterComponentCallbacks, unregisterDeviceIdChangeListener, unregisterReceiver, updateServiceGroup -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, getColor, getColorStateList, getDrawable, getString, getString, getSystemService, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onStartCommand
Integer onStartCommand(Intent intent, Integer flags, Integer startId)
Called by the system when the service is first created or when an intent is delivered to the service.
Handles several actions:
ACTION_START: Enables autostart and starts the Holochain service
ACTION_BOOT_COMPLETED: Starts the service if autostart is enabled
ACTION_APPROVE_APP_AUTHORIZATION: Authorizes an app to access Holochain
ACTION_DENY_APP_AUTHORIZATION: Dismisses an authorization request
- Parameters:
intent- The Intent supplied to startService(Intent)flags- Additional data about this start requeststartId- A unique integer representing this specific request to start
-
onBind
IBinder onBind(Intent intent)
Called when a client binds to the service with bindService().
Returns either an AdminBinder or AppBinder based on the "api" extra in the intent. For AppBinder, also requires an "installedAppId" extra.
- Parameters:
intent- The Intent passed to bindService()
-
stopForeground
final Unit stopForeground()
Stops the foreground service and shuts down the Holochain conductor.
-
-
-
-