Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92570bee06 | ||
|
|
05bb399893 | ||
|
|
831aa69da8 | ||
|
|
3bb2849a88 |
@@ -17,8 +17,8 @@ android {
|
||||
applicationId "com.termux"
|
||||
minSdkVersion project.properties.minSdkVersion.toInteger()
|
||||
targetSdkVersion project.properties.targetSdkVersion.toInteger()
|
||||
versionCode 105
|
||||
versionName "0.105"
|
||||
versionCode 106
|
||||
versionName "0.106"
|
||||
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Typeface;
|
||||
@@ -101,6 +102,8 @@ public final class TermuxActivity extends Activity implements ServiceConnection
|
||||
|
||||
private static final String RELOAD_STYLE_ACTION = "com.termux.app.reload_style";
|
||||
|
||||
private static final String BROADCAST_TERMUX_OPENED = "com.termux.app.OPENED";
|
||||
|
||||
/** The main view of the activity showing the terminal. Initialized in onCreate(). */
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
@@ -324,6 +327,26 @@ public final class TermuxActivity extends Activity implements ServiceConnection
|
||||
checkForFontAndColors();
|
||||
|
||||
mBellSoundId = mBellSoundPool.load(this, R.raw.bell, 1);
|
||||
|
||||
sendOpenedBroadcast();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a broadcast notifying Termux app has been opened
|
||||
*/
|
||||
void sendOpenedBroadcast() {
|
||||
Intent broadcast = new Intent(BROADCAST_TERMUX_OPENED);
|
||||
List<ResolveInfo> matches = getPackageManager().queryBroadcastReceivers(broadcast, 0);
|
||||
|
||||
// send broadcast to registered Termux receivers
|
||||
// this technique is needed to work around broadcast changes that Oreo introduced
|
||||
for (ResolveInfo info : matches) {
|
||||
Intent explicitBroadcast = new Intent(broadcast);
|
||||
ComponentName cname = new ComponentName(info.activityInfo.applicationInfo.packageName,
|
||||
info.activityInfo.name);
|
||||
explicitBroadcast.setComponent(cname);
|
||||
sendBroadcast(explicitBroadcast);
|
||||
}
|
||||
}
|
||||
|
||||
void toggleShowExtraKeys() {
|
||||
|
||||
@@ -1547,8 +1547,8 @@ public final class TerminalView extends View {
|
||||
};
|
||||
|
||||
propsFile = new File(possiblePropLocations[0]);
|
||||
int i = 1;
|
||||
while (!propsFile.exists() && i <= possiblePropLocations.length) {
|
||||
int i = 0;
|
||||
while (!propsFile.exists() && i < possiblePropLocations.length) {
|
||||
propsFile = new File(possiblePropLocations[i]);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user