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

Commit a718832e authored by Ying Wang's avatar Ying Wang
Browse files

Still use ro.monkey

http://b/issue?id=1681101
So just some refactoring.
parent 50cb76f5
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -74,9 +74,7 @@ public class DevelopmentSettings extends PreferenceActivity
    @Override
    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {

        // Those monkeys kept committing suicide, so we add this property
        // to disable this functionality
        if (!TextUtils.isEmpty(SystemProperties.get("monkey.running"))) {
        if (Utils.isMonkeyRunning()) {
            return false;
        }

+1 −3
Original line number Diff line number Diff line
@@ -204,9 +204,7 @@ public class LanguageSettings extends PreferenceActivity {
    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
        
        // Input Method stuff
        // Those monkeys kept committing suicide, so we add this property
        // to disable this functionality
        if (!TextUtils.isEmpty(SystemProperties.get("monkey.running"))) {
        if (Utils.isMonkeyRunning()) {
            return false;
        }

+1 −3
Original line number Diff line number Diff line
@@ -61,9 +61,7 @@ public class MasterClear extends Activity {
    private Button.OnClickListener mFinalClickListener = new Button.OnClickListener() {
            public void onClick(View v) {

                // Those monkeys kept committing suicide, so we add this property
                // to disable going through with the master clear
                if (!TextUtils.isEmpty(SystemProperties.get("monkey.running"))) {
                if (Utils.isMonkeyRunning()) {
                    return;
                }

+1 −3
Original line number Diff line number Diff line
@@ -61,9 +61,7 @@ public class MediaFormat extends Activity {
    private Button.OnClickListener mFinalClickListener = new Button.OnClickListener() {
            public void onClick(View v) {

                // Those monkeys kept committing suicide, so we add this property
                // to disable going through with the format
                if (!TextUtils.isEmpty(SystemProperties.get("monkey.running"))) {
                if (Utils.isMonkeyRunning()) {
                    return;
                }
                IMountService service =
+15 −7
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.SystemProperties;
import android.preference.Preference;
import android.preference.PreferenceGroup;

@@ -88,4 +89,11 @@ public class Utils {
        return true;
    }

    /**
     * Returns true if Monkey is running.
     */
    public static boolean isMonkeyRunning() {
        return SystemProperties.getBoolean("ro.monkey", false);
    }

}