Commit Test

This commit is contained in:
hyb1996
2017-04-29 21:23:45 +08:00
parent 6829c0659e
commit 51349356a7
65 changed files with 758 additions and 1751 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.stardust.autojs.runtime.api.AutomatorConfig;
import com.stardust.automator.AccessibilityEventCommandHost;
import com.stardust.scriptdroid.autojs.AutoJs;
@@ -18,11 +19,19 @@ public class Pref {
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(getString(R.string.key_run_mode))) {
AutoJs.getInstance().getCommandHost().setRunMode(getRunModeFromValue(sharedPreferences.getString(key, null)));
} else if (key.equals(getString(R.string.key_guard_mode))) {
AutomatorConfig.setIsUnintendedGuardEnabled(sharedPreferences.getBoolean(getString(R.string.key_guard_mode), false));
}
}
};
static {
AutomatorConfig.setIsUnintendedGuardEnabled(def().getBoolean(getString(R.string.key_guard_mode), false));
}
private static int getRunModeFromValue(String value) {
if (value == null)
return AccessibilityEventCommandHost.RUN_MODE_THREAD_POOL;
switch (value) {
case "KEY_THREAD_POOL":
return AccessibilityEventCommandHost.RUN_MODE_THREAD_POOL;