Compare commits

...

5 Commits
v0.70 ... v0.71

Author SHA1 Message Date
Fredrik Fornwall
81b5889a26 Bump version to 0.71 2019-05-21 21:52:39 +02:00
Leonid Plyushch
514f59258a let $PREFIX/tmp be cleaned when TermuxService is going to be stopped 2019-05-21 21:52:14 +02:00
Leonid Plyushch
9f79393aa5 Revert "clean /tmp directory on cold start"
This reverts commit beb8a004e6.
2019-05-21 21:52:14 +02:00
Leonid Plyushch
e49d514236 Revert "sessions: do not clear TMPDIR if application was not started"
This reverts commit bd45837d93.
2019-05-21 21:52:14 +02:00
Leonid Plyushch
4e1462326c remove intent category "default"
It was needed only when Termux had separate icon for failsafe activity.
2019-05-21 21:52:14 +02:00
4 changed files with 14 additions and 28 deletions

View File

@@ -14,8 +14,8 @@ android {
applicationId "com.termux"
minSdkVersion 21
targetSdkVersion 28
versionCode 70
versionName "0.70"
versionCode 71
versionName "0.71"
}
buildTypes {

View File

@@ -38,12 +38,10 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
</activity>

View File

@@ -482,7 +482,6 @@ public final class TermuxActivity extends Activity implements ServiceConnection
if (bundle != null) {
launchFailsafe = bundle.getBoolean(TERMUX_FAILSAFE_SESSION_ACTION, false);
}
clearTemporaryDirectory();
addNewSession(launchFailsafe, null);
} catch (WindowManager.BadTokenException e) {
// Activity finished - ignore.
@@ -496,7 +495,6 @@ public final class TermuxActivity extends Activity implements ServiceConnection
Intent i = getIntent();
if (i != null && Intent.ACTION_RUN.equals(i.getAction())) {
// Android 7.1 app shortcut from res/xml/shortcuts.xml.
clearTemporaryDirectory();
boolean failSafe = i.getBooleanExtra(TERMUX_FAILSAFE_SESSION_ACTION, false);
addNewSession(failSafe, null);
} else {
@@ -836,18 +834,4 @@ public final class TermuxActivity extends Activity implements ServiceConnection
}
}
private void clearTemporaryDirectory() {
if (mTermService.getSessions().size() == 0 && !mTermService.isWakelockEnabled()) {
File termuxTmpDir = new File(TermuxService.PREFIX_PATH + "/tmp");
if (termuxTmpDir.exists()) {
try {
TermuxInstaller.deleteFolder(termuxTmpDir);
} catch (Exception e) {
e.printStackTrace();
}
termuxTmpDir.mkdirs();
}
}
}
}

View File

@@ -237,6 +237,18 @@ public final class TermuxService extends Service implements SessionChangedCallba
@Override
public void onDestroy() {
File termuxTmpDir = new File(TermuxService.PREFIX_PATH + "/tmp");
if (termuxTmpDir.exists()) {
try {
TermuxInstaller.deleteFolder(termuxTmpDir.getCanonicalFile());
} catch (Exception e) {
Log.e(EmulatorDebug.LOG_TAG, "Error while removing directory " + termuxTmpDir.getAbsolutePath(), e);
}
termuxTmpDir.mkdirs();
}
if (mWakeLock != null) mWakeLock.release();
if (mWifiLock != null) mWifiLock.release();
@@ -250,14 +262,6 @@ public final class TermuxService extends Service implements SessionChangedCallba
return mTerminalSessions;
}
public boolean isWakelockEnabled() {
if (mWakeLock == null) {
return false;
} else {
return mWakeLock.isHeld();
}
}
TerminalSession createTermSession(String executablePath, String[] arguments, String cwd, boolean failSafe) {
new File(HOME_PATH).mkdirs();