summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/broadcastradio/hal2/ProgramInfoCache.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/broadcastradio/hal2/ProgramInfoCache.java b/services/core/java/com/android/server/broadcastradio/hal2/ProgramInfoCache.java
index 8c9389101141..6654c0c2304d 100644
--- a/services/core/java/com/android/server/broadcastradio/hal2/ProgramInfoCache.java
+++ b/services/core/java/com/android/server/broadcastradio/hal2/ProgramInfoCache.java
@@ -189,7 +189,8 @@ class ProgramInfoCache {
removed.add(id);
}
}
- if (modified.isEmpty() && removed.isEmpty() && mComplete == chunk.isComplete()) {
+ if (modified.isEmpty() && removed.isEmpty() && mComplete == chunk.isComplete()
+ && !chunk.isPurge()) {
return null;
}
mComplete = chunk.isComplete();
@@ -239,9 +240,10 @@ class ProgramInfoCache {
}
// Determine number of chunks we need to send.
- int numChunks = 0;
+ int numChunks = purge ? 1 : 0;
if (modified != null) {
- numChunks = roundUpFraction(modified.size(), maxNumModifiedPerChunk);
+ numChunks = Math.max(numChunks,
+ roundUpFraction(modified.size(), maxNumModifiedPerChunk));
}
if (removed != null) {
numChunks = Math.max(numChunks, roundUpFraction(removed.size(), maxNumRemovedPerChunk));