Browse Source

remove unused settings activity code, fix calling on 4.4

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/44/head
R4SAS 3 years ago
parent
commit
67fb27a6ce
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 2
      app/build.gradle
  2. 2
      app/jni/i2pd_android.cpp
  3. 2
      app/src/main/java/org/purplei2p/i2pd/DaemonWrapper.java
  4. 4
      app/src/main/java/org/purplei2p/i2pd/I2PDActivity.java
  5. 8
      app/src/main/java/org/purplei2p/i2pd/SettingsActivity.java
  6. 4
      app/src/main/res/layout/activity_settings.xml

2
app/build.gradle

@ -3,7 +3,7 @@ plugins { @@ -3,7 +3,7 @@ plugins {
}
dependencies {
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.core:core:1.6.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
}

2
app/jni/i2pd_android.cpp

@ -59,7 +59,7 @@ JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_startDaemon @@ -59,7 +59,7 @@ JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_startDaemon
JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getDataDir
(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

2
app/src/main/java/org/purplei2p/i2pd/DaemonWrapper.java

@ -152,7 +152,7 @@ public class DaemonWrapper { @@ -152,7 +152,7 @@ public class DaemonWrapper {
public void changeDataDir(String dataDir, Boolean updateAssets) {
I2PD_JNI.setDataDir(dataDir);
if( updateAssets ) processAssets();
if (updateAssets) processAssets();
//ToDo: move old dir to new dir?
}

4
app/src/main/java/org/purplei2p/i2pd/I2PDActivity.java

@ -325,10 +325,10 @@ public class I2PDActivity extends Activity { @@ -325,10 +325,10 @@ public class I2PDActivity extends Activity {
private void i2pdStop() {
cancelGracefulStop0();
new Thread(() -> {
Log.d(TAG, "stopping");
try {
textView.setText(getText(R.string.stopping));
new Thread(() -> {
try {
daemon.stopDaemon();
} catch (Throwable tr) {
Log.e(TAG, "", tr);

8
app/src/main/java/org/purplei2p/i2pd/SettingsActivity.java

@ -18,11 +18,10 @@ import java.util.List; @@ -18,11 +18,10 @@ import java.util.List;
import java.util.Objects;
import org.purplei2p.i2pd.iniedotr.IniEditor;
//import org.purplei2p.i2pd.iniedotr.IniEditor;
public class SettingsActivity extends Activity {
protected IniEditor iniedit = new IniEditor();
private String dataDir = DaemonWrapper.getDataDir();//for inieditor
//protected IniEditor iniedit = new IniEditor();
private String TAG = "i2pdSrvcSettings";
private File cacheDir;
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 { @@ -74,8 +73,6 @@ public class SettingsActivity extends Activity {
Uri.parse("package:" + getPackageName())
);
startActivityForResult(intent, 232);
} else {
//Permission Granted-System will work
}
}
}
@ -98,6 +95,7 @@ public class SettingsActivity extends Activity { @@ -98,6 +95,7 @@ public class SettingsActivity extends Activity {
if (!onBoot.exists()) {
requestPermission();
addAutoStartupSwitch();
try {
if (!onBoot.createNewFile())
Log.d(TAG, "Cant create new wile on: "+onBoot.getAbsolutePath());

4
app/src/main/res/layout/activity_settings.xml

@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/widget_edittext_dark"
android:orientation="vertical"
android:padding="@dimen/margin_medium"
tools:context=".SettingsActivity">
@ -24,7 +23,8 @@ @@ -24,7 +23,8 @@
android:gravity="left"
android:text="@string/autostart_enabled"
android:textOff="@string/disabled"
android:textOn="@string/enabled" />
android:textOn="@string/enabled"
tools:ignore="TouchTargetSizeCheck" />
<View
android:layout_width="match_parent"

Loading…
Cancel
Save