Commit 72079ad6 authored by Anthony Calosa's avatar Anthony Calosa Committed by Michael Kamensky

Fix Cinder Cloud and Noxious Gearhulk Interaction with Cards with CDA

(Noxious Gearhulk -> Malignus, as reported on forums)
parent e529765c
......@@ -7,8 +7,7 @@
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!-- This one needs Android Runtime Permission for Android 6+ -->
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......@@ -17,13 +17,10 @@ import;
import android.os.Bundle;
import android.os.Environment;
import android.os.PowerManager;
import android.provider.Settings;
import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
import android.view.WindowManager;
import android.webkit.MimeTypeMap;
import com.badlogic.gdx.Gdx;
import forge.FThreads;
import forge.Forge;
import forge.interfaces.IDeviceAdapter;
import forge.model.FModel;
......@@ -37,7 +34,6 @@ import;
import java.util.concurrent.Callable;
public class Main extends AndroidApplication {
public int time = -2;
protected void onCreate(Bundle savedInstanceState) {
......@@ -239,17 +235,16 @@ public class Main extends AndroidApplication {
public void preventSystemSleep(final boolean preventSleep) {
if (time == -2)
time = Settings.System.getInt(getContentResolver(), SCREEN_OFF_TIMEOUT, 0);
FThreads.invokeInEdtNowOrLater(new Runnable() { //must set window flags from EDT thread
// Setting getWindow() Flags needs to run on UI thread.
// Should fix android.view.ViewRoot$CalledFromWrongThreadException:
// Only the original thread that created a view hierarchy can touch its views.
runOnUiThread(new Runnable() {
public void run() {
if (preventSleep) {
Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, Integer.MAX_VALUE);
else {
Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, time);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment