Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cbd2944 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "MediaSessionService: Leave log for any session creation failure" into rvc-dev am: 0d2eacc8

Change-Id: I5be72773127e89668e7a9b28cca166f942ede7d2
parents e541d251 0d2eacc8
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -1134,8 +1134,19 @@ public class MediaSessionService extends SystemService implements Monitor {
                if (cb == null) {
                    throw new IllegalArgumentException("Controller callback cannot be null");
                }
                return createSessionInternal(pid, uid, resolvedUserId, packageName, cb, tag,
                        sessionInfo).getSessionBinder();
                MediaSessionRecord session = createSessionInternal(
                        pid, uid, resolvedUserId, packageName, cb, tag, sessionInfo);
                if (session == null) {
                    throw new IllegalStateException("Failed to create a new session record");
                }
                ISession sessionBinder = session.getSessionBinder();
                if (sessionBinder == null) {
                    throw new IllegalStateException("Invalid session record");
                }
                return sessionBinder;
            } catch (Exception e) {
                Slog.w(TAG, "Exception in creating a new session", e);
                throw e;
            } finally {
                Binder.restoreCallingIdentity(token);
            }