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

Commit 9769ef9f authored by Emily Bernier's avatar Emily Bernier
Browse files

Restore user switching logic.

Change-Id: I859145efc8e7f426ca7f7ad915b082b7e8a2c516
parent 5c6a8e32
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -656,14 +656,13 @@ public class UsbDeviceManager {
                    }
                    break;
                case MSG_USER_SWITCHED: {
                    mCurrentUser = msg.arg1;

                    UserManager userManager =
                            (UserManager) mContext.getSystemService(Context.USER_SERVICE);
                    if (userManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER)) {
                        Slog.v(TAG, "Switched to user with DISALLOW_USB_FILE_TRANSFER restriction;"
                                + " disabling USB.");
                        setUsbConfig("none");
                        mCurrentUser = msg.arg1;
                        break;
                    }

@@ -675,6 +674,7 @@ public class UsbDeviceManager {
                        setUsbConfig("none");
                        setUsbConfig(mCurrentFunctions);
                    }
                    mCurrentUser = msg.arg1;
                    break;
                }
            }