mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-05 02:05:25 +08:00
Work around Android < 7.0 wifi manager leak
http://tools.android.com/tech-docs/lint-in-studio-2-3#TOC-WifiManager-Leak
This commit is contained in:
@@ -49,8 +49,6 @@ import android.view.View.OnClickListener;
|
||||
import android.view.View.OnLongClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
|
@@ -104,7 +104,8 @@ public final class TermuxService extends Service implements SessionChangedCallba
|
||||
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, EmulatorDebug.LOG_TAG);
|
||||
mWakeLock.acquire();
|
||||
|
||||
WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
|
||||
// http://tools.android.com/tech-docs/lint-in-studio-2-3#TOC-WifiManager-Leak
|
||||
WifiManager wm = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
mWifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, EmulatorDebug.LOG_TAG);
|
||||
mWifiLock.acquire();
|
||||
|
||||
|
@@ -56,8 +56,6 @@ public final class TerminalEmulator {
|
||||
private static final int ESC_SELECT_LEFT_PAREN = 3;
|
||||
/** Escape processing: Have seen ESC and a character-set-select ) char */
|
||||
private static final int ESC_SELECT_RIGHT_PAREN = 4;
|
||||
/** Escape processing: Have seen ESC and a character-set-select + char */
|
||||
// private static final int ESC_SELECT_PLUS = 5;
|
||||
/** Escape processing: "ESC [" or CSI (Control Sequence Introducer). */
|
||||
private static final int ESC_CSI = 6;
|
||||
/** Escape processing: ESC [ ? */
|
||||
|
Reference in New Issue
Block a user