mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-05 17:56:59 +00:00
v2.4
This commit is contained in:
parent
a512997f38
commit
6d93a359fa
11 changed files with 58 additions and 19 deletions
|
|
@ -111,9 +111,6 @@ public class Config {
|
|||
return getCacheDir() + "/vectras/";
|
||||
}
|
||||
|
||||
public static String getTmpFolder() {
|
||||
return getBasefileDir() + "var/tmp"; // Do not modify
|
||||
}
|
||||
public static String machineFolder = "machines/";
|
||||
public static String getMachineDir(){
|
||||
return getBasefileDir() + machineFolder;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ Copyright (C) Max Kastanas 2012
|
|||
*/
|
||||
package com.vectras.qemu;
|
||||
|
||||
import static android.os.Build.VERSION.SDK_INT;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
|
|
@ -248,7 +250,9 @@ public class MainSettingsManager extends AppCompatActivity
|
|||
implements Preference.OnPreferenceChangeListener {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);/*
|
||||
super.onCreate(savedInstanceState);
|
||||
if (SDK_INT > 33)
|
||||
findPreference("sharedFolder").setEnabled(false);/*
|
||||
Preference pref = findPreference("customMemory");
|
||||
if (pref != null) {
|
||||
pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
|
|
@ -282,19 +286,23 @@ public class MainSettingsManager extends AppCompatActivity
|
|||
}
|
||||
|
||||
private void onMemory() {
|
||||
findPreference("memory").setEnabled(sp.getBoolean("customMemory", false));
|
||||
//findPreference("memory").setEnabled(sp.getBoolean("customMemory", false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
onMemory();
|
||||
if (SDK_INT > 33)
|
||||
findPreference("sharedFolder").setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
onMemory();
|
||||
if (SDK_INT > 33)
|
||||
findPreference("sharedFolder").setEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -302,7 +310,8 @@ public class MainSettingsManager extends AppCompatActivity
|
|||
public void onCreatePreferences(Bundle bundle, String root_key) {
|
||||
// Load the Preferences from the XML file
|
||||
setPreferencesFromResource(R.xml.qemu, root_key);
|
||||
|
||||
if (SDK_INT > 33)
|
||||
findPreference("sharedFolder").setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -660,30 +669,48 @@ public class MainSettingsManager extends AppCompatActivity
|
|||
edit.putString("vmUi", vmUi);
|
||||
edit.apply();
|
||||
}
|
||||
|
||||
public static String getVmUi(Activity activity) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
return prefs.getString("vmUi", "VNC");
|
||||
}
|
||||
|
||||
public static void setUsbTablet(Activity activity, boolean UsbTablet) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putBoolean("UsbTablet", UsbTablet);
|
||||
edit.apply();
|
||||
}
|
||||
|
||||
public static boolean getUsbTablet(Activity activity) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
return prefs.getBoolean("UsbTablet", false);
|
||||
}
|
||||
|
||||
public static void setCustomParams(Activity activity, String customParams) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putString("customParams", customParams);
|
||||
edit.apply();
|
||||
}
|
||||
|
||||
public static String getCustomParams(Activity activity) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
return prefs.getString("customParams", "");
|
||||
}
|
||||
|
||||
public static void setSharedFolder(Activity activity, boolean customParams) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putBoolean("customParams", customParams);
|
||||
edit.apply();
|
||||
}
|
||||
|
||||
public static boolean getSharedFolder(Activity activity) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
return prefs.getBoolean("sharedFolder", false);
|
||||
}
|
||||
|
||||
public static boolean isFirstLaunch(Activity activity) {
|
||||
PackageInfo pInfo = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.vectras.qemu.jni;
|
||||
|
||||
import static android.os.Build.VERSION.SDK_INT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
|
@ -77,7 +79,7 @@ public class StartVM {
|
|||
public String hdb_img_path;
|
||||
public String hdc_img_path;
|
||||
public String hdd_img_path;
|
||||
public String shared_folder_path;
|
||||
public String shared_folder_path = null;
|
||||
public int shared_folder_readonly = 1;
|
||||
public String hd_cache = "default";
|
||||
|
||||
|
|
@ -129,12 +131,14 @@ public class StartVM {
|
|||
extra_params += " ";
|
||||
extra_params += MainSettingsManager.getCustomParams(MainActivity.activity);
|
||||
|
||||
shared_folder_path = Config.sharedFolder;
|
||||
if (MainSettingsManager.getSharedFolder(MainActivity.activity) && SDK_INT < 33)
|
||||
shared_folder_path = Config.sharedFolder;
|
||||
//extra_params = Config.extra_params;
|
||||
this.context = context;
|
||||
this.libqemu = FileUtils.getNativeLibDir(context) + "/libqemu-system-x86_64.so";
|
||||
this.arch = "x86_64";
|
||||
this.cpuNum = MainSettingsManager.getCpuNum(MainActivity.activity);
|
||||
this.cpu = "qemu64";
|
||||
if (MainSettingsManager.getMTTCG(MainActivity.activity))
|
||||
this.enable_mttcg = 1;
|
||||
else
|
||||
|
|
@ -428,8 +432,7 @@ public class StartVM {
|
|||
|
||||
if (this.cpu != null && !cpu.equals("Default")) {
|
||||
paramsList.add("-cpu");
|
||||
String cpuParams = null;
|
||||
cpuParams += cpu;
|
||||
String cpuParams = cpu;
|
||||
if (enablleAvx)
|
||||
cpuParams += ",+avx";
|
||||
paramsList.add(cpuParams);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue