From d2708f0b427ad1ef40ea6d4af370bb95f64143e0 Mon Sep 17 00:00:00 2001 From: Arthur Hung Date: Tue, 19 Mar 2019 14:28:15 +0800 Subject: [PATCH] Fix no vibration when typing from time to time VibratorService would ignore the vibration request by checking if the uid state is in background from cache. But the cache updating from UidObserver would be handled after service connected and responded. That would cause some time gap to check if the process is in foreground. - Change to the full update when bindService that guarantees the UidObserver is called in time. Test: atest AppComponentFactoryTest Test: atest VibratorTest Test: Change software keyboard between different windows. Bug: 121436339 Change-Id: If260dc19e1a32c9dbb58c8ce960f295c6c919406 --- services/core/java/com/android/server/am/ActiveServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index e357ce8ce9295..1878d00ba9f95 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -1805,7 +1805,7 @@ public final class ActiveServices { || (callerApp.getCurProcState() <= ActivityManager.PROCESS_STATE_TOP && (flags & Context.BIND_TREAT_LIKE_ACTIVITY) != 0), b.client); - mAm.updateOomAdjLocked(s.app, true); + mAm.updateOomAdjLocked(); } if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "Bind " + s + " with " + b