From c28b3fda7010a7b265ee89987bf4e54cd6cbd769 Mon Sep 17 00:00:00 2001 From: jeffreyhuang Date: Mon, 13 Nov 2017 11:31:40 -0800 Subject: [PATCH] Prevent monkey from opening dev options Change-Id: I155fc195a9f800ff099592244f13228646f586ac Fixes: 68707778 Test: Manual with settings app --- .../DevelopmentSettingsDashboardFragment.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java index 83f395f8c2c..038f1831d8f 100644 --- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java +++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java @@ -134,6 +134,15 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra super(UserManager.DISALLOW_DEBUGGING_FEATURES); } + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + if (Utils.isMonkeyRunning()) { + getActivity().finish(); + return; + } + } + @Override public void onActivityCreated(Bundle icicle) { super.onActivityCreated(icicle);