am 3c8bbe24
: Check that mRemotePlayer is not null before use
* commit '3c8bbe245e7b0f937c36620c1427726fe9de50a6': Check that mRemotePlayer is not null before use
This commit is contained in:
@ -217,7 +217,7 @@ public class Ringtone {
|
|||||||
if (mAudioManager.getStreamVolume(mStreamType) != 0) {
|
if (mAudioManager.getStreamVolume(mStreamType) != 0) {
|
||||||
mLocalPlayer.start();
|
mLocalPlayer.start();
|
||||||
}
|
}
|
||||||
} else if (mAllowRemote) {
|
} else if (mAllowRemote && (mRemotePlayer != null)) {
|
||||||
final Uri canonicalUri = mUri.getCanonicalUri();
|
final Uri canonicalUri = mUri.getCanonicalUri();
|
||||||
try {
|
try {
|
||||||
mRemotePlayer.play(mRemoteToken, canonicalUri, mStreamType);
|
mRemotePlayer.play(mRemoteToken, canonicalUri, mStreamType);
|
||||||
@ -239,7 +239,7 @@ public class Ringtone {
|
|||||||
public void stop() {
|
public void stop() {
|
||||||
if (mLocalPlayer != null) {
|
if (mLocalPlayer != null) {
|
||||||
destroyLocalPlayer();
|
destroyLocalPlayer();
|
||||||
} else if (mAllowRemote) {
|
} else if (mAllowRemote && (mRemotePlayer != null)) {
|
||||||
try {
|
try {
|
||||||
mRemotePlayer.stop(mRemoteToken);
|
mRemotePlayer.stop(mRemoteToken);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@ -264,7 +264,7 @@ public class Ringtone {
|
|||||||
public boolean isPlaying() {
|
public boolean isPlaying() {
|
||||||
if (mLocalPlayer != null) {
|
if (mLocalPlayer != null) {
|
||||||
return mLocalPlayer.isPlaying();
|
return mLocalPlayer.isPlaying();
|
||||||
} else if (mAllowRemote) {
|
} else if (mAllowRemote && (mRemotePlayer != null)) {
|
||||||
try {
|
try {
|
||||||
return mRemotePlayer.isPlaying(mRemoteToken);
|
return mRemotePlayer.isPlaying(mRemoteToken);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
Reference in New Issue
Block a user