Java Code Examples for com.grarak.kerneladiutor.utils.Utils#saveBoolean()
The following examples show how to use
com.grarak.kerneladiutor.utils.Utils#saveBoolean() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CPU.java From KA27 with Apache License 2.0 | 5 votes |
public static void setPerCoreFreqControlEnabled(boolean active, Context context) { Utils.saveBoolean("Per_Core_Freq_Control_Enabled", active, context); //If deactivate reset freq to core 0 freq if (!active) { setMinFreq(getMinFreq(0, false), context); setMaxFreq(getMaxFreq(0, false), context); } }
Example 2
Source File: CPU.java From KA27 with Apache License 2.0 | 5 votes |
public static void setPerCoreGovControlEnabled(boolean active, Context context) { Utils.saveBoolean("Per_Core_Gov_Control_Enabled", active, context); //If deactivate reset gov to core 0 freq if (!active) { setGovernor(getCurGovernor(0, false), context); } }
Example 3
Source File: MainActivity.java From KA27 with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { this.registerReceiver(updateMainReceiver, new IntentFilter("updateMainReceiver")); } catch (NullPointerException ignored) {} setView(); String password; extractAssets(this); if (!(password = Utils.getString("password", "", this)).isEmpty()) askPassword(password); else new Task().execute(); // Use an AsyncTask to initialize everything Utils.saveBoolean("ka_run", true, MainActivity.this); }
Example 4
Source File: ProfileWidget.java From KA27 with Apache License 2.0 | 5 votes |
@Override public void onReceive(@NonNull final Context context, @NonNull Intent intent) { if (intent.getAction().equals(LIST_ITEM_CLICK)) { if (!Utils.getBoolean("profileclicked", false, context)) { Utils.saveBoolean("profileclicked", true, context); Utils.toast(context.getString(R.string.press_again_to_apply), context); new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(2000); Utils.saveBoolean("profileclicked", false, context); } catch (InterruptedException e) { e.printStackTrace(); } } }).start(); } else { Utils.saveBoolean("profileclicked", false, context); int position = intent.getIntExtra(ITEM_ARG, 0); ProfileDB profileDB = new ProfileDB(context); ProfileDB.ProfileItem profileItem = profileDB.getAllProfiles().get(position); RootUtils.SU su = new RootUtils.SU(); List < String > paths = profileItem.getPath(); for (int i = 0; i < paths.size(); i++) { Control.commandSaver(context, paths.get(i), profileItem.getCommands().get(i)); su.runCommand(profileItem.getCommands().get(i)); } su.close(); Utils.toast("Profile: \"" + profileItem.getName() + "\" applied.", context); } } super.onReceive(context, intent); }
Example 5
Source File: Screen.java From kernel_adiutor with Apache License 2.0 | 5 votes |
public static void activateScreenAutoHBM(boolean active, Context context) { Utils.saveBoolean("AutoHBM", active, context); Intent intent = new Intent(context, AutoHighBrightnessModeService.class); if (active) { context.startService(intent); } else { context.stopService(intent); } }
Example 6
Source File: CPU.java From kernel_adiutor with Apache License 2.0 | 5 votes |
public static void activatePerCoreControl(boolean active, Context context) { Utils.saveBoolean("MSM_Limiter_Per_Core_Control", active, context); if (active) { Control.deletespecificcommand(context, CPU_MSM_LIMITER_SCALING_GOVERNOR, null); for (int i = 0; i < CPU.getCoreCount(); i++) { CPU.setMSMLimiterGovernor(CPU.getMSMLimiterGovernor(-1), context, i); } } else { for (int i = 0; i < CPU.getCoreCount(); i++) { Control.deletespecificcommand(context, String.format(CPU_MSM_LIMITER_SCALING_GOVERNOR_PER_CORE, i), null); } CPU.setMSMLimiterGovernor(CPU.getMSMLimiterGovernor(0), context, -1); } }
Example 7
Source File: ProfileTileReceiver.java From kernel_adiutor with Apache License 2.0 | 5 votes |
public static void publishProfileTile(List<ProfileDB.ProfileItem> profiles, Context context) { if (!Utils.hasCMSDK()) return; if (profiles == null || profiles.size() < 1 || !Utils.getBoolean("profiletile", true, context)) { CMStatusBarManager.getInstance(context).removeTile(0); return; } Intent intent = new Intent(); intent.setAction(ACTION_TOGGLE_STATE); ArrayList<CustomTile.ExpandedGridItem> expandedGridItems = new ArrayList<>(); for (ProfileDB.ProfileItem item : profiles) { CustomTile.ExpandedGridItem expandedGridItem = new CustomTile.ExpandedGridItem(); expandedGridItem.setExpandedGridItemTitle(item.getName()); expandedGridItem.setExpandedGridItemDrawable(R.drawable.ic_launcher_preview); intent.putExtra(NAME, item.getName()); intent.putExtra(COMMANDS, item.getCommands().toArray(new String[item.getCommands().size()])); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); expandedGridItem.setExpandedGridItemOnClickIntent(pendingIntent); expandedGridItems.add(expandedGridItem); } CustomTile.GridExpandedStyle gridExpandedStyle = new CustomTile.GridExpandedStyle(); gridExpandedStyle.setGridItems(expandedGridItems); CustomTile mCustomTile = new CustomTile.Builder(context) .setExpandedStyle(gridExpandedStyle) .setLabel(R.string.profile) .setIcon(R.drawable.ic_launcher_preview) .build(); try { CMStatusBarManager.getInstance(context).publishTile(0, mCustomTile); } catch (Exception e) { Utils.saveBoolean("profiletile", false, context); Utils.toast(e.getMessage(), context, Toast.LENGTH_LONG); } }
Example 8
Source File: ProfileWidget.java From kernel_adiutor with Apache License 2.0 | 5 votes |
@Override public void onReceive(@NonNull final Context context, @NonNull Intent intent) { if (intent.getAction().equals(LIST_ITEM_CLICK)) { if (!Utils.getBoolean("profileclicked", false, context)) { Utils.saveBoolean("profileclicked", true, context); Utils.toast(context.getString(R.string.press_again_to_apply), context); new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(2000); Utils.saveBoolean("profileclicked", false, context); } catch (InterruptedException e) { e.printStackTrace(); } } }).start(); } else { Utils.saveBoolean("profileclicked", false, context); int position = intent.getIntExtra(ITEM_ARG, 0); ProfileDB profileDB = new ProfileDB(context); ProfileDB.ProfileItem profileItem = profileDB.getAllProfiles().get(position); RootUtils.SU su = new RootUtils.SU(); List<String> paths = profileItem.getPath(); for (int i = 0; i < paths.size(); i++) { Control.commandSaver(context, paths.get(i), profileItem.getCommands().get(i)); su.runCommand(profileItem.getCommands().get(i)); } su.close(); Utils.toast("Profile: \"" + profileItem.getName() + "\" applied.", context); } } super.onReceive(context, intent); }
Example 9
Source File: RecyclerViewFragment.java From KA27 with Apache License 2.0 | 4 votes |
public void applyOnBootChecked(boolean isChecked) { Utils.saveBoolean(getClassName() + "onboot", isChecked, getActivity()); Utils.toast(getString(isChecked ? R.string.apply_on_boot_enabled : R.string.apply_on_boot_disabled, getActionBar().getTitle()), getActivity()); }
Example 10
Source File: Sound.java From KA27 with Apache License 2.0 | 4 votes |
public static void setIndependentHeadphoneGainEnabled(boolean active, Context context) { Utils.saveBoolean("Independent_Headphone_Gain_Enabled", active, context); }
Example 11
Source File: RecyclerViewFragment.java From kernel_adiutor with Apache License 2.0 | 4 votes |
public void applyOnBootChecked(boolean isChecked) { Utils.saveBoolean(getClassName() + "onboot", isChecked, getActivity()); Utils.toast(getString(isChecked ? R.string.apply_on_boot_enabled : R.string.apply_on_boot_disabled, getActionBar().getTitle()), getActivity()); }
Example 12
Source File: Screen.java From kernel_adiutor with Apache License 2.0 | 4 votes |
public static void activateScreenHBMLock(boolean active, Context context) { Utils.saveBoolean("HBM_Lock", active, context); }
Example 13
Source File: Screen.java From kernel_adiutor with Apache License 2.0 | 4 votes |
public static void activateScreenHBMSmoothing(boolean active, Context context) { Utils.saveBoolean("AutoHBM_Smoothing", active, context); }
Example 14
Source File: Sound.java From kernel_adiutor with Apache License 2.0 | 4 votes |
public static void setIndependentHeadphoneGainEnabled(boolean active, Context context) { Utils.saveBoolean("Independent_Headphone_Gain_Enabled", active, context); }
Example 15
Source File: HBMWidget.java From kernel_adiutor with Apache License 2.0 | 4 votes |
private void setWidgetActive(boolean active, Context context){ Utils.saveBoolean("Widget_Active", active, context); }