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

Commit ccfbb1d6 authored by Guang Zhu's avatar Guang Zhu Committed by Android (Google) Code Review
Browse files

Merge "Monkey should not be allowed to switch USB mode" into mnc-dev

parents e74fdb8d 72aa5379
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();
                    }