MediaSessionService

com.bitmovin.player.api.media.session

MediaSessionService

abstract class MediaSessionService : MediaSessionService

Advertises media playback for a Player instance, through a MediaSession, by displaying media controls on the lock screen and in the notification area.

Constructors

MediaSessionServiceconstructor()

Properties

NameSummary
applicationval application: Application?
applicationContextopen val applicationContext: Context?
applicationInfoopen val applicationInfo: ApplicationInfo?
assetsopen val assets: AssetManager?
attributionSourceopen val attributionSource: AttributionSource
attributionTagopen val attributionTag: String?
baseContextopen val baseContext: Context?
cacheDiropen val cacheDir: File?
classLoaderopen val classLoader: ClassLoader?
codeCacheDiropen val codeCacheDir: File?
contentResolveropen val contentResolver: ContentResolver?
dataDiropen val dataDir: File?
deviceIdopen val deviceId: Int
displayopen val display: Display?
externalCacheDiropen val externalCacheDir: File?
externalCacheDirsopen val externalCacheDirs: Array<out File?>?
externalMediaDirsopen val externalMediaDirs: Array<out File?>?
filesDiropen val filesDir: File?
foregroundServiceTypeval foregroundServiceType: Int
isDeviceProtectedStorageopen val isDeviceProtectedStorage: Boolean
isPlaybackOngoing@get:UnstableApi
val isPlaybackOngoing: Boolean
isRestrictedopen val isRestricted: Boolean
isUiContextopen val isUiContext: Boolean
lifecycleopen override val lifecycle: Lifecycle
mainExecutoropen val mainExecutor: Executor?
mainLooperopen val mainLooper: Looper?
noBackupFilesDiropen val noBackupFilesDir: File?
obbDiropen val obbDir: File?
obbDirsopen val obbDirs: Array<out File?>?
opPackageNameopen val opPackageName: String
packageCodePathopen val packageCodePath: String?
packageManageropen val packageManager: PackageManager?
packageNameopen val packageName: String?
packageResourcePathopen val packageResourcePath: String?
paramsopen val params: ContextParams?
resourcesopen val resources: Resources?
sessionsval sessions: List<MediaSession>
themeopen val theme: Resources.Theme?
updateableFlagsopen val updateableFlags: Context.BindServiceFlags
wallpaperopen val wallpaper: Drawable?
wallpaperDesiredMinimumHeightopen val wallpaperDesiredMinimumHeight: Int
wallpaperDesiredMinimumWidthopen val wallpaperDesiredMinimumWidth: Int

Functions

NameSummary
addSessionfun addSession(session: MediaSession)
fun addSession(session: MediaSession)
bindIsolatedServiceopen fun bindIsolatedService(service: Intent, flags: Context.BindServiceFlags, instanceName: String, executor: Executor, conn: ServiceConnection): Boolean
open fun bindIsolatedService(service: Intent, flags: Int, instanceName: String, executor: Executor, conn: ServiceConnection): Boolean
bindServiceopen fun bindService(service: Intent, conn: ServiceConnection, flags: Context.BindServiceFlags): Boolean
open fun bindService(service: Intent, conn: ServiceConnection, flags: Int): Boolean
open fun bindService(service: Intent, flags: Context.BindServiceFlags, executor: Executor, conn: ServiceConnection): Boolean
open fun bindService(service: Intent, flags: Int, executor: Executor, conn: ServiceConnection): Boolean
bindServiceAsUseropen fun bindServiceAsUser(service: Intent, conn: ServiceConnection, flags: Context.BindServiceFlags, user: UserHandle): Boolean
open fun bindServiceAsUser(service: Intent, conn: ServiceConnection, flags: Int, user: UserHandle): Boolean
checkCallingOrSelfPermissionopen fun checkCallingOrSelfPermission(permission: String): Int
checkCallingOrSelfUriPermissionopen fun checkCallingOrSelfUriPermission(uri: Uri?, modeFlags: Int): Int
checkCallingOrSelfUriPermissionsopen fun checkCallingOrSelfUriPermissions(uris: List<Uri?>, modeFlags: Int): IntArray
checkCallingPermissionopen fun checkCallingPermission(permission: String): Int
checkCallingUriPermissionopen fun checkCallingUriPermission(uri: Uri?, modeFlags: Int): Int
checkCallingUriPermissionsopen fun checkCallingUriPermissions(uris: List<Uri?>, modeFlags: Int): IntArray
checkContentUriPermissionFullopen fun checkContentUriPermissionFull(uri: Uri, pid: Int, uid: Int, modeFlags: Int): Int
checkPermissionopen fun checkPermission(permission: String, pid: Int, uid: Int): Int
checkSelfPermissionopen fun checkSelfPermission(permission: String): Int
checkUriPermissionopen fun checkUriPermission(uri: Uri?, pid: Int, uid: Int, modeFlags: Int): Int
open fun checkUriPermission(uri: Uri?, readPermission: String?, writePermission: String?, pid: Int, uid: Int, modeFlags: Int): Int
checkUriPermissionsopen fun checkUriPermissions(uris: List<Uri?>, pid: Int, uid: Int, modeFlags: Int): IntArray
clearListener@UnstableApi
fun clearListener()
clearWallpaperopen fun clearWallpaper()
createAttributionContextopen fun createAttributionContext(attributionTag: String?): Context
createConfigurationContextopen fun createConfigurationContext(overrideConfiguration: Configuration): Context?
createContextopen fun createContext(contextParams: ContextParams): Context
createContextForSplitopen fun createContextForSplit(splitName: String?): Context?
createDeviceContextopen fun createDeviceContext(deviceId: Int): Context
createDeviceProtectedStorageContextopen fun createDeviceProtectedStorageContext(): Context?
createDisplayContextopen fun createDisplayContext(display: Display): Context?
createPackageContextopen fun createPackageContext(packageName: String?, flags: Int): Context?
createWindowContextopen fun createWindowContext(type: Int, options: Bundle?): Context
open fun createWindowContext(display: Display, type: Int, options: Bundle?): Context
databaseListopen fun databaseList(): Array<out String?>?
deleteDatabaseopen fun deleteDatabase(name: String?): Boolean
deleteFileopen fun deleteFile(name: String?): Boolean
deleteSharedPreferencesopen fun deleteSharedPreferences(name: String?): Boolean
enforceCallingOrSelfPermissionopen fun enforceCallingOrSelfPermission(permission: String, message: String?)
enforceCallingOrSelfUriPermissionopen fun enforceCallingOrSelfUriPermission(uri: Uri?, modeFlags: Int, message: String?)
enforceCallingPermissionopen fun enforceCallingPermission(permission: String, message: String?)
enforceCallingUriPermissionopen fun enforceCallingUriPermission(uri: Uri?, modeFlags: Int, message: String?)
enforcePermissionopen fun enforcePermission(permission: String, pid: Int, uid: Int, message: String?)
enforceUriPermissionopen fun enforceUriPermission(uri: Uri?, pid: Int, uid: Int, modeFlags: Int, message: String?)
open fun enforceUriPermission(uri: Uri?, readPermission: String?, writePermission: String?, pid: Int, uid: Int, modeFlags: Int, message: String?)
fileListopen fun fileList(): Array<out String?>?
getColorfun getColor(id: Int): Int
getColorStateListfun getColorStateList(id: Int): ColorStateList
getDatabasePathopen fun getDatabasePath(name: String?): File?
getDiropen fun getDir(name: String?, mode: Int): File?
getDrawablefun getDrawable(id: Int): Drawable?
getExternalFilesDiropen fun getExternalFilesDir(type: String?): File?
getExternalFilesDirsopen fun getExternalFilesDirs(type: String?): Array<out File?>?
getFileStreamPathopen fun getFileStreamPath(name: String?): File?
getSharedPreferencesopen fun getSharedPreferences(name: String?, mode: Int): SharedPreferences?
getStringfun getString(resId: Int): String
fun getString(resId: Int, vararg formatArgs: Any?): String
getSystemServicefun <T : Any?> getSystemService(serviceClass: Class<T?>): T?
open fun getSystemService(name: String): Any?
getSystemServiceNameopen fun getSystemServiceName(serviceClass: Class<*>): String?
getTextfun getText(resId: Int): CharSequence
grantUriPermissionopen fun grantUriPermission(toPackage: String?, uri: Uri?, modeFlags: Int)
isSessionAddedfun isSessionAdded(session: MediaSession): Boolean
fun isSessionAdded(session: MediaSession): Boolean
moveDatabaseFromopen fun moveDatabaseFrom(sourceContext: Context?, name: String?): Boolean
moveSharedPreferencesFromopen fun moveSharedPreferencesFrom(sourceContext: Context?, name: String?): Boolean
obtainStyledAttributesfun obtainStyledAttributes(attrs: IntArray): TypedArray
fun obtainStyledAttributes(set: AttributeSet?, attrs: IntArray): TypedArray
fun obtainStyledAttributes(resid: Int, attrs: IntArray): TypedArray
fun obtainStyledAttributes(set: AttributeSet?, attrs: IntArray, defStyleAttr: Int, defStyleRes: Int): TypedArray
onBind@CallSuper
@Nullable
open fun onBind(@Nullableintent: Intent?): IBinder?
onConfigurationChangedopen fun onConfigurationChanged(newConfig: Configuration)
onCreate@CallSuper
open fun onCreate()
onDestroy@CallSuper
open fun onDestroy()
onGetSessionoverride fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaSession?
abstract fun onGetSession(controllerInfo: ControllerInfo): MediaSession?
Needs to be overridden to provide a MediaSession instance. MediaSession instances have to be created using either the MediaSession factory method or MediaSessionBuilder.
onLowMemoryopen fun onLowMemory()
onRebindopen fun onRebind(intent: Intent?)
onStart@CallSuper
open override fun onStart(intent: Intent?, startId: Int)
onStartCommand@CallSuper
open fun onStartCommand(@Nullableintent: Intent?, flags: Int, startId: Int): Int
onTaskRemovedopen fun onTaskRemoved(@NullablerootIntent: Intent?)
onTimeoutopen fun onTimeout(startId: Int)
open fun onTimeout(startId: Int, fgsType: Int)
onTrimMemoryopen fun onTrimMemory(level: Int)
onUnbindopen fun onUnbind(intent: Intent?): Boolean
onUpdateNotificationopen fun onUpdateNotification(session: MediaSession)
open fun onUpdateNotification(session: MediaSession, startInForegroundRequired: Boolean)
onUpdateNotificationAsync@UnstableApi
open fun onUpdateNotificationAsync(session: MediaSession, startInForegroundRequired: Boolean): ListenableFuture<@NullableTypeVoid?>
openFileInputopen fun openFileInput(name: String?): FileInputStream?
openFileOutputopen fun openFileOutput(name: String?, mode: Int): FileOutputStream?
openOrCreateDatabaseopen fun openOrCreateDatabase(name: String?, mode: Int, factory: SQLiteDatabase.CursorFactory?): SQLiteDatabase?
open fun openOrCreateDatabase(name: String?, mode: Int, factory: SQLiteDatabase.CursorFactory?, errorHandler: DatabaseErrorHandler?): SQLiteDatabase?
pauseAllPlayersAndStopSelf@UnstableApi
fun pauseAllPlayersAndStopSelf()
peekWallpaperopen fun peekWallpaper(): Drawable?
rebindServiceopen fun rebindService(conn: ServiceConnection, flags: Context.BindServiceFlags)
registerComponentCallbacksopen fun registerComponentCallbacks(callback: ComponentCallbacks?)
registerDeviceIdChangeListeneropen fun registerDeviceIdChangeListener(executor: Executor, listener: IntConsumer)
registerReceiveropen fun registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter?): Intent?
open fun registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter?, flags: Int): Intent?
open fun registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter?, broadcastPermission: String?, scheduler: Handler?): Intent?
open fun registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter?, broadcastPermission: String?, scheduler: Handler?, flags: Int): Intent?
removeSessionfun removeSession(session: MediaSession)
fun removeSession(session: MediaSession)
removeStickyBroadcastopen fun removeStickyBroadcast(intent: Intent?)
removeStickyBroadcastAsUseropen fun removeStickyBroadcastAsUser(intent: Intent?, user: UserHandle?)
revokeSelfPermissionOnKillopen fun revokeSelfPermissionOnKill(permName: String)
revokeSelfPermissionsOnKillopen fun revokeSelfPermissionsOnKill(permissions: Collection<String?>)
revokeUriPermissionopen fun revokeUriPermission(uri: Uri?, modeFlags: Int)
open fun revokeUriPermission(targetPackage: String?, uri: Uri?, modeFlags: Int)
sendBroadcastopen fun sendBroadcast(intent: Intent?)
open fun sendBroadcast(intent: Intent?, receiverPermission: String?)
open fun sendBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?)
sendBroadcastAsUseropen fun sendBroadcastAsUser(intent: Intent?, user: UserHandle?)
open fun sendBroadcastAsUser(intent: Intent?, user: UserHandle?, receiverPermission: String?)
sendBroadcastWithMultiplePermissionsopen fun sendBroadcastWithMultiplePermissions(intent: Intent, receiverPermissions: Array<out String?>)
sendOrderedBroadcastopen fun sendOrderedBroadcast(intent: Intent?, receiverPermission: String?)
open fun sendOrderedBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?)
open fun sendOrderedBroadcast(intent: Intent, receiverPermission: String?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialCode: Int, initialData: String?, initialExtras: Bundle?)
open fun sendOrderedBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialCode: Int, initialData: String?, initialExtras: Bundle?)
open fun sendOrderedBroadcast(intent: Intent, receiverPermission: String?, receiverAppOp: String?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialCode: Int, initialData: String?, initialExtras: Bundle?)
open fun sendOrderedBroadcast(intent: Intent, initialCode: Int, receiverPermission: String?, receiverAppOp: String?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialData: String?, initialExtras: Bundle?, options: Bundle?)
sendOrderedBroadcastAsUseropen fun sendOrderedBroadcastAsUser(intent: Intent?, user: UserHandle?, receiverPermission: String?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialCode: Int, initialData: String?, initialExtras: Bundle?)
sendStickyBroadcastopen fun sendStickyBroadcast(intent: Intent?)
open fun sendStickyBroadcast(intent: Intent, options: Bundle?)
sendStickyBroadcastAsUseropen fun sendStickyBroadcastAsUser(intent: Intent?, user: UserHandle?)
sendStickyOrderedBroadcastopen fun sendStickyOrderedBroadcast(intent: Intent?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialCode: Int, initialData: String?, initialExtras: Bundle?)
sendStickyOrderedBroadcastAsUseropen fun sendStickyOrderedBroadcastAsUser(intent: Intent?, user: UserHandle?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialCode: Int, initialData: String?, initialExtras: Bundle?)
setForegroundServiceTimeoutMs@UnstableApi
fun setForegroundServiceTimeoutMs(foregroundServiceTimeoutMs: Long)
setListener@UnstableApi
fun setListener(listener: MediaSessionService.Listener)
setShowNotificationForIdlePlayer@UnstableApi
fun setShowNotificationForIdlePlayer(showNotificationForIdlePlayerMode: Int)
setThemeopen fun setTheme(resid: Int)
setWallpaperopen fun setWallpaper(bitmap: Bitmap?)
open fun setWallpaper(data: InputStream?)
startActivitiesopen fun startActivities(intents: Array<out Intent?>?)
open fun startActivities(intents: Array<out Intent?>?, options: Bundle?)
startActivityopen fun startActivity(intent: Intent?)
open fun startActivity(intent: Intent?, options: Bundle?)
startForegroundfun startForeground(id: Int, notification: Notification?)
fun startForeground(id: Int, notification: Notification, foregroundServiceType: Int)
startForegroundServiceopen fun startForegroundService(service: Intent?): ComponentName?
startInstrumentationopen fun startInstrumentation(className: ComponentName, profileFile: String?, arguments: Bundle?): Boolean
startIntentSenderopen fun startIntentSender(intent: IntentSender?, fillInIntent: Intent?, flagsMask: Int, flagsValues: Int, extraFlags: Int)
open fun startIntentSender(intent: IntentSender?, fillInIntent: Intent?, flagsMask: Int, flagsValues: Int, extraFlags: Int, options: Bundle?)
startServiceopen fun startService(service: Intent?): ComponentName?
stopForegroundfun stopForeground(removeNotification: Boolean)
fun stopForeground(notificationBehavior: Int)
stopSelffun stopSelf()
fun stopSelf(startId: Int)
stopSelfResultfun stopSelfResult(startId: Int): Boolean
stopServiceopen fun stopService(name: Intent?): Boolean
triggerNotificationUpdate@UnstableApi
fun triggerNotificationUpdate()
unbindServiceopen fun unbindService(conn: ServiceConnection)
unregisterComponentCallbacksopen fun unregisterComponentCallbacks(callback: ComponentCallbacks?)
unregisterDeviceIdChangeListeneropen fun unregisterDeviceIdChangeListener(listener: IntConsumer)
unregisterReceiveropen fun unregisterReceiver(receiver: BroadcastReceiver?)
updateServiceBindingsopen fun updateServiceBindings(params: Collection<Context.UpdateBindingParams?>)
updateServiceGroupopen fun updateServiceGroup(conn: ServiceConnection, group: Int, importance: Int)