forked from len0rd/rockbox
Remove the use of the instance field in non-anymore-static methods
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28412 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bf63f24168
commit
c8901b3506
1 changed files with 15 additions and 19 deletions
|
@ -310,31 +310,27 @@ public class RockboxService extends Service
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startForeground()
|
public void startForeground()
|
||||||
{
|
|
||||||
if (instance != null)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Send the notification.
|
* Send the notification.
|
||||||
* We use a layout id because it is a unique number.
|
* We use a layout id because it is a unique number.
|
||||||
* We use it later to cancel.
|
* We use it later to cancel.
|
||||||
*/
|
*/
|
||||||
instance.mNM.notify(R.string.notification, instance.notification);
|
mNM.notify(R.string.notification, instance.notification);
|
||||||
/*
|
/*
|
||||||
* this call makes the service run as foreground, which
|
* this call makes the service run as foreground, which
|
||||||
* provides enough cpu time to do music decoding in the
|
* provides enough cpu time to do music decoding in the
|
||||||
* background
|
* background
|
||||||
*/
|
*/
|
||||||
instance.startForegroundCompat(R.string.notification,
|
startForegroundCompat(R.string.notification, notification);
|
||||||
instance.notification);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopForeground()
|
public void stopForeground()
|
||||||
{
|
{
|
||||||
if (instance.notification != null)
|
if (notification != null)
|
||||||
{
|
{
|
||||||
instance.stopForegroundCompat(R.string.notification);
|
stopForegroundCompat(R.string.notification);
|
||||||
instance.mNM.cancel(R.string.notification);
|
mNM.cancel(R.string.notification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue