diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 06:17:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 06:17:15 +0000 |
commit | ac8d05af898765571f7f7db4b8bfc8b73907652d (patch) | |
tree | 0a1a0e03b3c49df9b7713587b9d423dc5d8a2709 /mobile/android/geckoview | |
parent | Releasing progress-linux version 127.0.1-1~progress7.99u1. (diff) | |
download | firefox-ac8d05af898765571f7f7db4b8bfc8b73907652d.tar.xz firefox-ac8d05af898765571f7f7db4b8bfc8b73907652d.zip |
Merging upstream version 127.0.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/geckoview')
-rw-r--r-- | mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java index aaf8810bbb..444ee633b6 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java @@ -8,6 +8,7 @@ import android.media.MediaCodec; import android.media.MediaCodecInfo.CodecCapabilities; import android.media.MediaCrypto; import android.media.MediaFormat; +import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -134,7 +135,18 @@ import org.mozilla.gecko.util.HardwareCodecCapabilityUtils; } /* package */ LollipopAsyncCodec(final String name) throws IOException { - mCodec = MediaCodec.createByCodecName(name); + // Create the codec. + // We wrap the call to MediaCodec.createByCodecName in a pair of + // clearCallingIdentity / restoreCallingIdentity, so that the resource + // gets attributed to this process and not to whichever process was calling us. + // This works around a battery usage attribution bug in Android 14+, + // see bug 1902077. + final long token = Binder.clearCallingIdentity(); + try { + mCodec = MediaCodec.createByCodecName(name); + } finally { + Binder.restoreCallingIdentity(token); + } } @Override |