diff options
| -rw-r--r-- | core/jni/com_android_internal_os_Zygote.cpp | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/TaskStack.java | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 4783a257755f..82c27f02ba87 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -1160,6 +1160,7 @@ static jlong CalculateCapabilities(JNIEnv* env, jint uid, jint gid, jintArray gi /* * Grant the following capabilities to the Bluetooth user: * - CAP_WAKE_ALARM + * - CAP_NET_ADMIN * - CAP_NET_RAW * - CAP_NET_BIND_SERVICE (for DHCP client functionality) * - CAP_SYS_NICE (for setting RT priority for audio-related threads) @@ -1167,6 +1168,7 @@ static jlong CalculateCapabilities(JNIEnv* env, jint uid, jint gid, jintArray gi if (multiuser_get_app_id(uid) == AID_BLUETOOTH) { capabilities |= (1LL << CAP_WAKE_ALARM); + capabilities |= (1LL << CAP_NET_ADMIN); capabilities |= (1LL << CAP_NET_RAW); capabilities |= (1LL << CAP_NET_BIND_SERVICE); capabilities |= (1LL << CAP_SYS_NICE); diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 481c3ba24fca..114a56feaf73 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -1936,8 +1936,12 @@ public class TaskStack extends WindowContainer<Task> implements public boolean setPinnedStackAlpha(float alpha) { // Hold the lock since this is called from the BoundsAnimator running on the UiThread synchronized (mWmService.mGlobalLock) { - getPendingTransaction().setAlpha(getSurfaceControl(), - mCancelCurrentBoundsAnimation ? 1 : alpha); + final SurfaceControl sc = getSurfaceControl(); + if (sc == null || !sc.isValid()) { + // If the stack is already removed, don't bother updating any stack animation + return false; + } + getPendingTransaction().setAlpha(sc, mCancelCurrentBoundsAnimation ? 1 : alpha); scheduleAnimation(); return !mCancelCurrentBoundsAnimation; } |