From b2926b1ddb65c03bd417ba57121533fbf4286ee7 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Thu, 11 May 2017 11:13:52 -0700 Subject: [PATCH] Fix a security exception when unbinding services Clear calling identity before calling oom adjust. Bug: 38183641 Test: manual Change-Id: Ia3cc7bb83a94d1bb280a43912a250bddc9ef2c11 --- services/core/java/com/android/server/am/ActiveServices.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 1ed46a00bb5ae..5e03508580526 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -1493,12 +1493,13 @@ public final class ActiveServices { mAm.updateOomAdjLocked(r.binding.service.app, false); } } + + mAm.updateOomAdjLocked(); + } finally { Binder.restoreCallingIdentity(origId); } - mAm.updateOomAdjLocked(); - return true; }