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

Commit 32e90552 authored by Jaewan Kim's avatar Jaewan Kim
Browse files

MediaSessionService: Replace Log.wtf() with Log.w()

Log.wtf() should be used only if it's enough to restart system, so
replace it with Log.w() when it's not.

Bug: 118987354
Test: Build
Change-Id: If40f5519d36c40873dba8f6eaae9fd5a7f92c753
parent 12288221
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -284,13 +284,16 @@ public class MediaSessionServiceImpl extends MediaSessionService.ServiceImpl {
     * Tells the system UI that volume has changed on an active remote session.
     */
    public void notifyRemoteVolumeChanged(int flags, MediaSessionRecord session) {
        synchronized (mLock) {
            if (mRvc == null || !session.isActive()) {
                return;
            }
            try {
                mRvc.remoteVolumeChanged(session.getSessionToken(), flags);
            } catch (Exception e) {
            Log.wtf(TAG, "Error sending volume change to system UI.", e);
                Log.w(TAG, "Error sending volume change to system UI.", e);
                mRvc = null;
            }
        }
    }

@@ -563,7 +566,7 @@ public class MediaSessionServiceImpl extends MediaSessionService.ServiceImpl {
            String callerPackageName, SessionCallbackLink cb, String tag) {
        FullUserRecord user = getFullUserRecordLocked(userId);
        if (user == null) {
            Log.wtf(TAG, "Request from invalid user: " +  userId);
            Log.w(TAG, "Request from invalid user: " +  userId + ", pkg=" + callerPackageName);
            throw new RuntimeException("Session request from invalid user.");
        }

@@ -643,7 +646,8 @@ public class MediaSessionServiceImpl extends MediaSessionService.ServiceImpl {
                MediaSessionRecord record = user.mPriorityStack.getDefaultRemoteSession(userId);
                mRvc.updateRemoteController(record == null ? null : record.getSessionToken());
            } catch (RemoteException e) {
                Log.wtf(TAG, "Error sending default remote volume to sys ui.", e);
                Log.w(TAG, "Error sending default remote volume to sys ui.", e);
                mRvc = null;
            }
        }
    }
@@ -1661,7 +1665,9 @@ public class MediaSessionServiceImpl extends MediaSessionService.ServiceImpl {
            final long token = Binder.clearCallingIdentity();
            try {
                enforceSystemUiPermission("listen for volume changes", pid, uid);
                synchronized (mLock) {
                    mRvc = rvc;
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }