// Path: src/com/elefher/abstractclasses/CustomLinearLayoutOnTheFly.java
// public abstract class CustomLinearLayoutOnTheFly {
//     protected LinearLayout layout, statusLayout;
//     protected TextView textView;
//     protected MiscProgressBar progressBar;
//     protected LinearLayout.LayoutParams progressBarParams, textViewParams, layoutParams, statusLayoutParams;
// 
//     public void textViewAddView(){
//         layout.addView(textView);
//     }
// 
//     public void progressBarAddView(){
//         layout.addView(progressBar);
//     }
// 
//     public void display(){
//         statusLayout.setOrientation(LinearLayout.VERTICAL);
//         statusLayout.addView(layout);
//     }
// 
//     public LinearLayout getLayout(){
//         return layout;
//     }
// 
//     public abstract void layoutSettings();
//     public abstract void layoutParams();
//     public abstract void textViewSettings();
//     public abstract void textViewParams();
//     public abstract void setText();
//     public abstract void progressBarSettings();
//     public abstract void progressBarParams();
//     public abstract void setCurrentProgressBar();
//     public abstract void update();
// }
// 
// Path: src/com/elefher/customclasses/CpuGovernors.java
// public class CpuGovernors {
// 
// 	public CpuGovernors() {
// 
// 	}
// 
// 	public static String[] getAvailableGovernors(Context cntx) {
// 		String[] governors = CpuUtils.readStringArray(findFilePath("scaling_available_governors", cntx));
// 
// 		// In case does not exist governors return null
// 		if (governors == null) {
// 			return null;
// 		}
// 
// 		return governors;
// 	}
// 	
// 	public static String getCurrentGovernor(Context cntx){
// 		String currentGov = "";
// 		try {
// 			currentGov = ReadFile.getStringOfFile(findFilePath("scaling_governor", cntx));
// 		}catch (NullPointerException e){
// 			currentGov = "Unknown";
// 			e.printStackTrace();
// 		}
// 		return currentGov;
// 	}
// 	
// 	public static boolean setGovernor(String governor, Context cntx){
// 		if(governor.isEmpty())
// 			return false;
// 		
// 		String scaling_governor = findFilePath("scaling_governor", cntx);
// 		int cores = CpuStat.getNumCores();
// 		try {
// 			List<String> commands = new ArrayList<String>();
// 
// 			for (int i = 0; i < cores; i++) {
// 				/*
// 				 * Prepare permissions so that we can write
// 				 */
// 				commands.add("chmod 0664 "
// 						+ scaling_governor.replace("cpu0", "cpu" + i) + "\n");
// 
// 				commands.add("echo " + governor + " > "
// 						+ scaling_governor.replace("cpu0", "cpu" + i) + "\n");
// 
// 				/*
// 				 * Set permissions in initial state
// 				 */
// 				commands.add("chmod 0444 "
// 						+ scaling_governor.replace("cpu0", "cpu" + i) + "\n");
// 			}
// 
// 			commands.add("exit\n");
// 
// 			Process p = Runtime.getRuntime().exec(CpuUtils.getSUbinaryPath());
// 			DataOutputStream dos = new DataOutputStream(p.getOutputStream());
// 			for (String command : commands) {
// 				dos.writeBytes(command);
// 				dos.flush();
// 			}
// 			dos.close();			
// 			
// 			p.waitFor();
// 			return true;
// 		} catch (Exception ex) {
// 			Log.e("", ex.toString() + " Error: " + ex.getMessage());
// 			return false;
// 		}
// 	}
// 
// 	private static String findFilePath(String file, Context cntx){
// 		try {
// 			String path = ReadFile.existPath(ReadFile.getListOfFile("data/paths.json", "path", file, cntx));
// 			return path;
// 		} catch (JSONException e) {
// 			e.printStackTrace();
// 		}
// 		return null;
// 	}
// }


import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.elefher.abstractclasses.CustomLinearLayoutOnTheFly;
import com.elefher.customclasses.CpuGovernors;
        layout.setLayoutParams(layoutParams);
        layout.setOrientation(LinearLayout.HORIZONTAL);
    }

    @Override
    public void layoutParams() {
        layoutParams = new LinearLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.MATCH_PARENT,
                android.view.ViewGroup.LayoutParams.MATCH_PARENT, 1.0f);
    }

    @Override
    public void textViewSettings() {
        textView = new TextView(cntx);
        textViewParams();
        textView.setLayoutParams(textViewParams);
        textView.setTypeface(Typeface.MONOSPACE);
        textView.setTextColor(Color.WHITE);
        textView.setTextSize(15);
    }

    @Override
    public void textViewParams() {
        textViewParams = new LinearLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.FILL_PARENT, 50);
        textViewParams.setMargins(20, 20, 0, 0);
    }

    @Override
    public void setText() {
// Path: src/com/elefher/abstractclasses/CustomLinearLayoutOnTheFly.java
// public abstract class CustomLinearLayoutOnTheFly {
//     protected LinearLayout layout, statusLayout;
//     protected TextView textView;
//     protected MiscProgressBar progressBar;
//     protected LinearLayout.LayoutParams progressBarParams, textViewParams, layoutParams, statusLayoutParams;
// 
//     public void textViewAddView(){
//         layout.addView(textView);
//     }
// 
//     public void progressBarAddView(){
//         layout.addView(progressBar);
//     }
// 
//     public void display(){
//         statusLayout.setOrientation(LinearLayout.VERTICAL);
//         statusLayout.addView(layout);
//     }
// 
//     public LinearLayout getLayout(){
//         return layout;
//     }
// 
//     public abstract void layoutSettings();
//     public abstract void layoutParams();
//     public abstract void textViewSettings();
//     public abstract void textViewParams();
//     public abstract void setText();
//     public abstract void progressBarSettings();
//     public abstract void progressBarParams();
//     public abstract void setCurrentProgressBar();
//     public abstract void update();
// }
// 
// Path: src/com/elefher/customclasses/CpuGovernors.java
// public class CpuGovernors {
// 
// 	public CpuGovernors() {
// 
// 	}
// 
// 	public static String[] getAvailableGovernors(Context cntx) {
// 		String[] governors = CpuUtils.readStringArray(findFilePath("scaling_available_governors", cntx));
// 
// 		// In case does not exist governors return null
// 		if (governors == null) {
// 			return null;
// 		}
// 
// 		return governors;
// 	}
// 	
// 	public static String getCurrentGovernor(Context cntx){
// 		String currentGov = "";
// 		try {
// 			currentGov = ReadFile.getStringOfFile(findFilePath("scaling_governor", cntx));
// 		}catch (NullPointerException e){
// 			currentGov = "Unknown";
// 			e.printStackTrace();
// 		}
// 		return currentGov;
// 	}
// 	
// 	public static boolean setGovernor(String governor, Context cntx){
// 		if(governor.isEmpty())
// 			return false;
// 		
// 		String scaling_governor = findFilePath("scaling_governor", cntx);
// 		int cores = CpuStat.getNumCores();
// 		try {
// 			List<String> commands = new ArrayList<String>();
// 
// 			for (int i = 0; i < cores; i++) {
// 				/*
// 				 * Prepare permissions so that we can write
// 				 */
// 				commands.add("chmod 0664 "
// 						+ scaling_governor.replace("cpu0", "cpu" + i) + "\n");
// 
// 				commands.add("echo " + governor + " > "
// 						+ scaling_governor.replace("cpu0", "cpu" + i) + "\n");
// 
// 				/*
// 				 * Set permissions in initial state
// 				 */
// 				commands.add("chmod 0444 "
// 						+ scaling_governor.replace("cpu0", "cpu" + i) + "\n");
// 			}
// 
// 			commands.add("exit\n");
// 
// 			Process p = Runtime.getRuntime().exec(CpuUtils.getSUbinaryPath());
// 			DataOutputStream dos = new DataOutputStream(p.getOutputStream());
// 			for (String command : commands) {
// 				dos.writeBytes(command);
// 				dos.flush();
// 			}
// 			dos.close();			
// 			
// 			p.waitFor();
// 			return true;
// 		} catch (Exception ex) {
// 			Log.e("", ex.toString() + " Error: " + ex.getMessage());
// 			return false;
// 		}
// 	}
// 
// 	private static String findFilePath(String file, Context cntx){
// 		try {
// 			String path = ReadFile.existPath(ReadFile.getListOfFile("data/paths.json", "path", file, cntx));
// 			return path;
// 		} catch (JSONException e) {
// 			e.printStackTrace();
// 		}
// 		return null;
// 	}
// }


// Path: src/com/elefher/extendedclasses/GovernorLinearLayout.java
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.elefher.abstractclasses.CustomLinearLayoutOnTheFly;
import com.elefher.customclasses.CpuGovernors;

        layout.setLayoutParams(layoutParams);
        layout.setOrientation(LinearLayout.HORIZONTAL);
    }

    @Override
    public void layoutParams() {
        layoutParams = new LinearLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.MATCH_PARENT,
                android.view.ViewGroup.LayoutParams.MATCH_PARENT, 1.0f);
    }

    @Override
    public void textViewSettings() {
        textView = new TextView(cntx);
        textViewParams();
        textView.setLayoutParams(textViewParams);
        textView.setTypeface(Typeface.MONOSPACE);
        textView.setTextColor(Color.WHITE);
        textView.setTextSize(15);
    }

    @Override
    public void textViewParams() {
        textViewParams = new LinearLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.FILL_PARENT, 50);
        textViewParams.setMargins(20, 20, 0, 0);
    }

    @Override
    public void setText() {
        textView.setText("Governor: " + CpuGovernors.getCurrentGovernor(cntx)