Required on at least Android 5. Otherwise utilities that use dalvikvm may fail.
Issue happens on Nexus 7 with official 5.0/5.1 firmware and possibly other
AOSP ROMs.
The failsafe activity were infrequently used while confusing users.
Replace it with an app shortcut on Android 7.1+ and a separate app on
earlier versions.
As the notification icon and text is set to black, ROMs like Samsung OneUI and themes that change notifications to have a dark background will have visibility issues with Termux notifications. This commit sets a neutral color which will be visible on both white and dark backgrounds.
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: com.termux, PID: 15799
AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.widget.ToggleButton.isPressed()' on a null object reference
AndroidRuntime: at com.termux.app.ExtraKeysView.readSpecialButton(ExtraKeysView.java:119)
AndroidRuntime: at com.termux.app.TermuxViewClient.readControlKey(TermuxViewClient.java:116)
AndroidRuntime: at com.termux.view.TerminalView.inputCodePoint(TerminalView.java:655)
AndroidRuntime: at com.termux.view.TerminalView$2.sendTextToTerminal(TerminalView.java:336)
AndroidRuntime: at com.termux.view.TerminalView$2.commitText(TerminalView.java:273)
AndroidRuntime: at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:341)
AndroidRuntime: at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:85)
AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6944)
AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Also enables session autoclosing so no more "annoying" messages
about "process completed - press enter". There autoclosing will be
performed on exit codes '0' and '130'.
On Android TV devices old behaviour will be used - auto close enabled for all
sessions when amount of running sessions >1.