Merge "Fix a regression in assist when context is disabled" into nyc-dev am: c3c45fa

am: 40411c1

* commit '40411c158c8b071ba9175f514b1fa370ff438cc5':
  Fix a regression in assist when context is disabled

Change-Id: I5beebccebd76317f06e545bbea57e999b8cdbe06
This commit is contained in:
TreeHugger Robot
2016-04-23 01:04:51 +00:00
committed by android-build-merger

View File

@@ -370,20 +370,28 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
}
if (mHaveAssistData) {
AssistDataForActivity assistData;
while (!mAssistData.isEmpty()) {
if (mPendingAssistDataCount <= 0) {
Slog.e(TAG, "mPendingAssistDataCount is " + mPendingAssistDataCount);
if (mAssistData.isEmpty()) {
// We're not actually going to get any data, deliver some nothing
try {
mSession.handleAssist(null, null, null, 0, 0);
} catch (RemoteException e) {
}
mPendingAssistDataCount--;
assistData = mAssistData.remove(0);
if (assistData.data == null) {
try {
mSession.handleAssist(null, null, null, assistData.activityIndex,
assistData.activityCount);
} catch (RemoteException e) {
} else {
while (!mAssistData.isEmpty()) {
if (mPendingAssistDataCount <= 0) {
Slog.e(TAG, "mPendingAssistDataCount is " + mPendingAssistDataCount);
}
mPendingAssistDataCount--;
assistData = mAssistData.remove(0);
if (assistData.data == null) {
try {
mSession.handleAssist(null, null, null, assistData.activityIndex,
assistData.activityCount);
} catch (RemoteException e) {
}
} else {
deliverSessionDataLocked(assistData);
}
} else {
deliverSessionDataLocked(assistData);
}
}
if (mPendingAssistDataCount <= 0) {