mirror of
https://github.com/PurpleI2P/i2pd-android.git
synced 2025-01-08 22:07:57 +00:00
remove unused settings activity code, fix calling on 4.4
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
c62429513f
commit
67fb27a6ce
@ -3,7 +3,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.core:core:1.3.2'
|
implementation 'androidx.core:core:1.6.0'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_startDaemon
|
|||||||
|
|
||||||
JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getDataDir
|
JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getDataDir
|
||||||
(JNIEnv *env, jclass clazz) {
|
(JNIEnv *env, jclass clazz) {
|
||||||
return env->NewStringUTF( i2p::android::GetDataDir().c_str() );
|
return env->NewStringUTF(i2p::android::GetDataDir().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_stopDaemon
|
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_stopDaemon
|
||||||
|
@ -152,7 +152,7 @@ public class DaemonWrapper {
|
|||||||
|
|
||||||
public void changeDataDir(String dataDir, Boolean updateAssets) {
|
public void changeDataDir(String dataDir, Boolean updateAssets) {
|
||||||
I2PD_JNI.setDataDir(dataDir);
|
I2PD_JNI.setDataDir(dataDir);
|
||||||
if( updateAssets ) processAssets();
|
if (updateAssets) processAssets();
|
||||||
//ToDo: move old dir to new dir?
|
//ToDo: move old dir to new dir?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,10 +325,10 @@ public class I2PDActivity extends Activity {
|
|||||||
|
|
||||||
private void i2pdStop() {
|
private void i2pdStop() {
|
||||||
cancelGracefulStop0();
|
cancelGracefulStop0();
|
||||||
new Thread(() -> {
|
|
||||||
Log.d(TAG, "stopping");
|
Log.d(TAG, "stopping");
|
||||||
try {
|
|
||||||
textView.setText(getText(R.string.stopping));
|
textView.setText(getText(R.string.stopping));
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
daemon.stopDaemon();
|
daemon.stopDaemon();
|
||||||
} catch (Throwable tr) {
|
} catch (Throwable tr) {
|
||||||
Log.e(TAG, "", tr);
|
Log.e(TAG, "", tr);
|
||||||
|
@ -18,11 +18,10 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
import org.purplei2p.i2pd.iniedotr.IniEditor;
|
//import org.purplei2p.i2pd.iniedotr.IniEditor;
|
||||||
|
|
||||||
public class SettingsActivity extends Activity {
|
public class SettingsActivity extends Activity {
|
||||||
protected IniEditor iniedit = new IniEditor();
|
//protected IniEditor iniedit = new IniEditor();
|
||||||
private String dataDir = DaemonWrapper.getDataDir();//for inieditor
|
|
||||||
private String TAG = "i2pdSrvcSettings";
|
private String TAG = "i2pdSrvcSettings";
|
||||||
private File cacheDir;
|
private File cacheDir;
|
||||||
public static String onBootFileName="/onBoot"; // just file, empty, if exist the do autostart, if not then no.
|
public static String onBootFileName="/onBoot"; // just file, empty, if exist the do autostart, if not then no.
|
||||||
@ -74,8 +73,6 @@ public class SettingsActivity extends Activity {
|
|||||||
Uri.parse("package:" + getPackageName())
|
Uri.parse("package:" + getPackageName())
|
||||||
);
|
);
|
||||||
startActivityForResult(intent, 232);
|
startActivityForResult(intent, 232);
|
||||||
} else {
|
|
||||||
//Permission Granted-System will work
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,6 +95,7 @@ public class SettingsActivity extends Activity {
|
|||||||
if (!onBoot.exists()) {
|
if (!onBoot.exists()) {
|
||||||
requestPermission();
|
requestPermission();
|
||||||
addAutoStartupSwitch();
|
addAutoStartupSwitch();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!onBoot.createNewFile())
|
if (!onBoot.createNewFile())
|
||||||
Log.d(TAG, "Cant create new wile on: "+onBoot.getAbsolutePath());
|
Log.d(TAG, "Cant create new wile on: "+onBoot.getAbsolutePath());
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/widget_edittext_dark"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="@dimen/margin_medium"
|
android:padding="@dimen/margin_medium"
|
||||||
tools:context=".SettingsActivity">
|
tools:context=".SettingsActivity">
|
||||||
@ -24,7 +23,8 @@
|
|||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
android:text="@string/autostart_enabled"
|
android:text="@string/autostart_enabled"
|
||||||
android:textOff="@string/disabled"
|
android:textOff="@string/disabled"
|
||||||
android:textOn="@string/enabled" />
|
android:textOn="@string/enabled"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user