mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-17 03:15:39 +00:00
Android: Enable sustained performance mode
This commit is contained in:
parent
7dc71027cf
commit
96ff8c87e5
|
@ -5,6 +5,7 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.hardware.input.InputManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
|
@ -174,6 +175,10 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
|||
// Hook up controller input.
|
||||
updateControllers();
|
||||
registerInputDeviceListener();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
getWindow().setSustainedPerformanceMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -197,6 +202,10 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
|||
AndroidHostInterface.getInstance().stopEmulationThread();
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
getWindow().setSustainedPerformanceMode(false);
|
||||
}
|
||||
|
||||
unregisterInputDeviceListener();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue