Merge "Wait 100 ms for assistant response before posting."

This commit is contained in:
Julia Reynolds
2017-01-06 01:30:44 +00:00
committed by Android (Google) Code Review
4 changed files with 178 additions and 81 deletions

View File

@@ -92,6 +92,7 @@ interface INotificationManager
void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
void setInterruptionFilter(String pkg, int interruptionFilter);
void applyEnqueuedAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment);
void applyAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment);
void applyAdjustmentsFromAssistant(in INotificationListener token, in List<Adjustment> adjustments);
void createNotificationChannelFromAssistant(in INotificationListener token, String pkg, in NotificationChannel channel);

View File

@@ -210,7 +210,14 @@ public abstract class NotificationAssistantService extends NotificationListenerS
args.recycle();
Adjustment adjustment = onNotificationEnqueued(sbn, importance, user);
if (adjustment != null) {
adjustNotification(adjustment);
if (!isBound()) return;
try {
getNotificationInterface().applyEnqueuedAdjustmentFromAssistant(
mWrapper, adjustment);
} catch (android.os.RemoteException ex) {
Log.v(TAG, "Unable to contact notification manager", ex);
throw ex.rethrowFromSystemServer();
}
}
} break;
}