mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-02 16:20:30 +00:00
v2.9.1-fix3a
This commit is contained in:
parent
0c76ecdb69
commit
de5b21869a
4 changed files with 357 additions and 8 deletions
|
|
@ -162,12 +162,13 @@ public class CustomRomActivity extends AppCompatActivity {
|
|||
TextInputLayout cdromLayout = findViewById(R.id.cdromField);
|
||||
TextView arch = findViewById(R.id.textArch);
|
||||
arch.setText(MainSettingsManager.getArch(this));
|
||||
ImageView ivIcon = findViewById(R.id.ivIcon);
|
||||
icon.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("image/jpeg");
|
||||
intent.setType("image/*");
|
||||
|
||||
// Optionally, specify a URI for the file that should appear in the
|
||||
// system file picker when it loads.
|
||||
|
|
@ -183,7 +184,23 @@ public class CustomRomActivity extends AppCompatActivity {
|
|||
public void onClick(View v) {
|
||||
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("image/jpeg");
|
||||
intent.setType("image/*");
|
||||
|
||||
// Optionally, specify a URI for the file that should appear in the
|
||||
// system file picker when it loads.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Environment.DIRECTORY_DOWNLOADS);
|
||||
}
|
||||
|
||||
startActivityForResult(intent, 1001);
|
||||
}
|
||||
});
|
||||
ivIcon.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("image/*");
|
||||
|
||||
// Optionally, specify a URI for the file that should appear in the
|
||||
// system file picker when it loads.
|
||||
|
|
@ -477,7 +494,7 @@ public class CustomRomActivity extends AppCompatActivity {
|
|||
if(imgFile.exists()){
|
||||
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
|
||||
|
||||
ImageView ivIcon = findViewById(R.id.ivIcon);
|
||||
ivIcon = findViewById(R.id.ivIcon);
|
||||
|
||||
ivIcon.setImageBitmap(myBitmap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,8 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
.setMessage("To ensure the app functions correctly, please disable battery optimization for this app.")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Disable", (dialog, which) -> {
|
||||
Intent intent = new Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS);
|
||||
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + getApplicationContext().getPackageName()));
|
||||
startActivity(intent);
|
||||
})
|
||||
.show();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ public class StartVM {
|
|||
|
||||
String[] qemu = new String[0];
|
||||
|
||||
String bios = "";
|
||||
|
||||
|
||||
ArrayList<String> params = new ArrayList<>(Arrays.asList(qemu));
|
||||
|
||||
|
|
@ -91,8 +93,13 @@ public class StartVM {
|
|||
|
||||
//params.add(soundDevice);
|
||||
|
||||
String bios = "-bios ";
|
||||
bios += AppConfig.basefiledir + "bios-vectras.bin";
|
||||
if (MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
bios = "-L ";
|
||||
bios += "openbios-ppc";
|
||||
} else {
|
||||
bios = "-bios ";
|
||||
bios += AppConfig.basefiledir + "bios-vectras.bin";
|
||||
}
|
||||
|
||||
String machine = "-M ";
|
||||
if (Objects.equals(MainSettingsManager.getArch(activity), "X86_64")) {
|
||||
|
|
@ -109,7 +116,9 @@ public class StartVM {
|
|||
params.add("-rtc");
|
||||
params.add("base=localtime");
|
||||
|
||||
params.add("-nodefaults");
|
||||
if (!MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
params.add("-nodefaults");
|
||||
}
|
||||
|
||||
if (!Objects.equals(MainSettingsManager.getArch(activity), "ARM64")) {
|
||||
params.add(bios);
|
||||
|
|
@ -131,11 +140,15 @@ public class StartVM {
|
|||
params.add(qmpParams);
|
||||
}
|
||||
|
||||
params.add("-monitor");
|
||||
if (!MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
params.add("-monitor");
|
||||
}
|
||||
if (MainSettingsManager.getArch(activity).equals("ARM64"))
|
||||
params.add("stdio");
|
||||
else
|
||||
if (!MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
params.add("vc");
|
||||
}
|
||||
} else if (MainSettingsManager.getVmUi(activity).equals("SPICE")) {
|
||||
String spiceStr = "-spice ";
|
||||
spiceStr += "port=6999,disable-ticketing=on";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue