0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-19 19:42:29 +02:00

Minor cleanups

This commit is contained in:
Arne Schwabe 2021-10-04 16:55:35 +02:00
parent cf093699bd
commit e171dca738
4 changed files with 16 additions and 4 deletions

View File

@ -139,6 +139,7 @@ public class ConfirmDialog extends Activity implements
@Override
public void onBackPressed() {
super.onBackPressed();
setResult(RESULT_CANCELED);
finish();
}

View File

@ -127,14 +127,14 @@ class LogFileHandler extends Handler {
}
private void readLogCache(File cacheDir) {
FileInputStream log = null;
try {
File logfile = new File(cacheDir, LOGFILE_NAME);
if (!logfile.exists() || !logfile.canRead())
return;
FileInputStream log = new FileInputStream(logfile);
log = new FileInputStream(logfile);
readCacheContents(log);
log.close();
@ -148,6 +148,13 @@ class LogFileHandler extends Handler {
VpnStatus.readFileLog = true;
VpnStatus.readFileLock.notifyAll();
}
if (log != null) {
try {
log.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

View File

@ -28,7 +28,7 @@ import java.io.IOException;
public class StatusListener implements VpnStatus.LogListener {
private File mCacheDir;
private Context mContext;
private IStatusCallbacks mCallback = new IStatusCallbacks.Stub() {
private final IStatusCallbacks mCallback = new IStatusCallbacks.Stub() {
@Override
public void newLogItem(LogItem item) throws RemoteException {
VpnStatus.newLogItem(item);
@ -50,7 +50,7 @@ public class StatusListener implements VpnStatus.LogListener {
VpnStatus.setConnectedVPNProfile(uuid);
}
};
private ServiceConnection mConnection = new ServiceConnection() {
private final ServiceConnection mConnection = new ServiceConnection() {
@Override
@ -76,6 +76,7 @@ public class StatusListener implements VpnStatus.LogListener {
len = fd.readShort();
}
fd.close();
pfd.close();
} else {

View File

@ -9,15 +9,18 @@
<application tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity
android:exported="true"
android:name=".activities.NotImplemented"
tools:ignore="ExportedActivity" />
<activity-alias
android:exported="true"
android:name=".activities.LogWindow"
android:targetActivity=".activities.NotImplemented"
/>
<activity-alias
android:exported="true"
android:name=".activities.Req"
android:targetActivity=".activities.NotImplemented"
/>