Android Open Source - ShellAndroid Cpu






From Project

Back to project page ShellAndroid.

License

The source code is released under:

Apache License

If you think the Android project ShellAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package z.hol.shellandroid;
//from  www .ja  v a 2  s  . c om
/**
 * CPU information
 */
final class Cpu {

  public static final int CPU_ARM = 0;
  public static final int CPU_MIPS = 1;
  public static final int CPU_INTEL = 2;

  /**
   * get cpu type, {@link #CPU_ARM}, {@link #CPU_INTEL}, {@link #CPU_MIPS}
   * @return
   */
  public static int getCpuType(){
    int c = 0;
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO){
      int c1 = translateCputType(android.os.Build.CPU_ABI);
      int c2 = translateCputType(android.os.Build.CPU_ABI2);
      if (c1 != c2){
          c = c1 != CPU_ARM ? c1 : c2;
      }else{
          c = c1;
      }
    }else{
        c = translateCputType(android.os.Build.CPU_ABI);
    }
    return c;
  }
  
  private static int translateCputType(String cpuAbi){
      int c = 0;
      if ("armeabi".equals(cpuAbi)){
          c = CPU_ARM;
      }else if ("x86".equals(cpuAbi)){
          c = CPU_INTEL;
      }else if ("mips".equals(cpuAbi)){
          c = CPU_MIPS;
      }
      return c;
  }
  
}




Java Source Code List

z.hol.shellandroid.AbsReleaser.java
z.hol.shellandroid.CFlagRelease.java
z.hol.shellandroid.Chmod.java
z.hol.shellandroid.Cpu.java
z.hol.shellandroid.DefaultChmod.java
z.hol.shellandroid.LollipopReleaser.java
z.hol.shellandroid.NormalReleaser.java
z.hol.shellandroid.ShellAndroid.java
z.hol.shellandroid.ShellChmod.java
z.hol.shellandroid.Shell.java
z.hol.shellandroid.example.MainActivity.java
z.hol.shellandroid.exception.ShellExecuteException.java
z.hol.shellandroid.utils.AssetUtils.java
z.hol.shellandroid.utils.ShellUtils.java