Merge "Update IRemoteControlDisplay when it registers."
This commit is contained in:
committed by
Android (Google) Code Review
commit
2db44c5838
@@ -3084,7 +3084,7 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
mRcDisplay.setCurrentClientId(
|
mRcDisplay.setCurrentClientId(
|
||||||
newClientGeneration, newClientEventReceiver, clearing);
|
newClientGeneration, newClientEventReceiver, clearing);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Dead display in onRcDisplayUpdate() "+e);
|
Log.e(TAG, "Dead display in setNewRcClientOnDisplays_syncRcsCurrc() "+e);
|
||||||
// if we had a display before, stop monitoring its death
|
// if we had a display before, stop monitoring its death
|
||||||
rcDisplay_stopDeathMonitor_syncRcStack();
|
rcDisplay_stopDeathMonitor_syncRcStack();
|
||||||
mRcDisplay = null;
|
mRcDisplay = null;
|
||||||
@@ -3103,7 +3103,7 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
try {
|
try {
|
||||||
se.mRcClient.setCurrentClientGenerationId(newClientGeneration);
|
se.mRcClient.setCurrentClientGenerationId(newClientGeneration);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.w(TAG, "Dead client in onRcDisplayUpdate()"+e);
|
Log.w(TAG, "Dead client in setNewRcClientGenerationOnClients_syncRcsCurrc()"+e);
|
||||||
stackIterator.remove();
|
stackIterator.remove();
|
||||||
se.unlinkToRcClientDeath();
|
se.unlinkToRcClientDeath();
|
||||||
}
|
}
|
||||||
@@ -3160,7 +3160,7 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
rcse.mReceiverComponent /*event receiver*/,
|
rcse.mReceiverComponent /*event receiver*/,
|
||||||
false /*clearing*/);
|
false /*clearing*/);
|
||||||
|
|
||||||
// ask the current client that it needs to send info
|
// tell the current client that it needs to send info
|
||||||
try {
|
try {
|
||||||
mCurrentRcClient.onInformationRequested(mCurrentRcClientGen,
|
mCurrentRcClient.onInformationRequested(mCurrentRcClientGen,
|
||||||
flags, mArtworkExpectedWidth, mArtworkExpectedHeight);
|
flags, mArtworkExpectedWidth, mArtworkExpectedHeight);
|
||||||
@@ -3457,6 +3457,21 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we have a new display, tell the current client that it needs to send info
|
||||||
|
// (following lock order: mRCStack then mCurrentRcLock)
|
||||||
|
synchronized(mCurrentRcLock) {
|
||||||
|
if (mCurrentRcClient != null) {
|
||||||
|
// tell the current client that it needs to send info
|
||||||
|
try {
|
||||||
|
mCurrentRcClient.onInformationRequested(mCurrentRcClientGen,
|
||||||
|
RC_INFO_ALL, mArtworkExpectedWidth, mArtworkExpectedHeight);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.e(TAG, "Current valid remote client is dead: "+e);
|
||||||
|
mCurrentRcClient = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user