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

Commit 72aa5379 authored by Guang Zhu's avatar Guang Zhu
Browse files

Monkey should not be allowed to switch USB mode

Change-Id: Ifb4865d234e0d9e6453f88d37c12744b9daefa62
parent 6ee5a4d0
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();
                    }