Loading services/core/java/com/android/server/vibrator/VibrationSettings.java +10 −4 Original line number Diff line number Diff line Loading @@ -731,20 +731,26 @@ final class VibrationSettings { private final SparseArray<Integer> mProcStatesCache = new SparseArray<>(); public boolean isUidForeground(int uid) { synchronized (this) { return mProcStatesCache.get(uid, ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND) <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND; } } @Override public void onUidGone(int uid, boolean disabled) { synchronized (this) { mProcStatesCache.delete(uid); } } @Override public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) { synchronized (this) { mProcStatesCache.put(uid, procState); } } } /** * Implementation of Virtual Device listeners for the changes of virtual displays and of apps Loading Loading
services/core/java/com/android/server/vibrator/VibrationSettings.java +10 −4 Original line number Diff line number Diff line Loading @@ -731,20 +731,26 @@ final class VibrationSettings { private final SparseArray<Integer> mProcStatesCache = new SparseArray<>(); public boolean isUidForeground(int uid) { synchronized (this) { return mProcStatesCache.get(uid, ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND) <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND; } } @Override public void onUidGone(int uid, boolean disabled) { synchronized (this) { mProcStatesCache.delete(uid); } } @Override public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) { synchronized (this) { mProcStatesCache.put(uid, procState); } } } /** * Implementation of Virtual Device listeners for the changes of virtual displays and of apps Loading