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

Commit 9d936600 authored by Guang Zhu's avatar Guang Zhu Committed by The Android Automerger
Browse files

Monkey should not be allowed to switch USB mode

Change-Id: Ifb4865d234e0d9e6453f88d37c12744b9daefa62
parent a4fe6d50
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -18,12 +18,14 @@ package com.android.settings.deviceinfo;

import android.annotation.Nullable;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.hardware.usb.UsbManager;
import android.os.Bundle;
import android.util.Log;

import com.android.settings.R;

/**
@@ -46,7 +48,9 @@ public class UsbModeChooserActivity extends Activity {
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        if (!ActivityManager.isUserAMonkey()) {
                            setCurrentFunction(which);
                        }
                        dialog.dismiss();
                        UsbModeChooserActivity.this.finish();
                    }