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

Commit 6f38816b authored by Robert Wu's avatar Robert Wu Committed by Android (Google) Code Review
Browse files

Merge "MIDI: Add null check for UserManager.getMainUser" into main

parents 9fa1b1e1 6553ea49
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1012,7 +1012,11 @@ public class MidiService extends IMidiManager.Stub {
            }
        }

        if (user.getUserIdentifier() == mUserManager.getMainUser().getIdentifier()) {
        // Allow only the main user to create BluetoothMidiService.
        // If there is no main user, allow all users to create it.
        UserHandle mainUser = mUserManager.getMainUser();
        if ((mainUser == null)
                || (user.getUserIdentifier() == mainUser.getIdentifier())) {
            PackageInfo info;
            try {
                info = mPackageManager.getPackageInfoAsUser(