merge of '412007995e44aa866ff698a168742c4c330a62ef'
and '5bb8ab81cd3ab734f3c6b6d67d53eff28c5f5558'
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
0.9.46 2020-6-03
|
||||
* catch ActivityNotFound exception in MainActivity
|
||||
|
||||
0.9.45
|
||||
* No significant changes
|
||||
|
||||
0.9.44 / 2019-12-03
|
||||
* Updated translations
|
||||
* Bumped target sdk version to 28, enforced by google
|
||||
|
@ -16,6 +16,7 @@ import android.preference.PreferenceManager;
|
||||
import android.provider.Settings;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.util.AndroidRuntimeException;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -27,6 +28,7 @@ import android.widget.ScrollView;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import net.i2p.android.I2PActivityBase;
|
||||
@ -646,32 +648,34 @@ public class MainFragment extends I2PFragmentBase {
|
||||
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||
if (!pm.isIgnoringBatteryOptimizations(packageName)) {
|
||||
AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
|
||||
b.setTitle(R.string.configure_no_doze_title)
|
||||
.setMessage(R.string.configure_no_doze)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int i) {
|
||||
String packageName = mContext.getPackageName();
|
||||
dialog.dismiss();
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, true);
|
||||
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + packageName));
|
||||
try {
|
||||
mContext.startActivity(intent);
|
||||
} catch (ActivityNotFoundException activityNotFound) {
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, true);
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int i) {
|
||||
dialog.cancel();
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, false);
|
||||
}
|
||||
})
|
||||
.show();
|
||||
b.setTitle(R.string.configure_no_doze_title);
|
||||
b.setMessage(R.string.configure_no_doze);
|
||||
b.setCancelable(false);
|
||||
b.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int i) {
|
||||
String packageName = mContext.getPackageName();
|
||||
dialog.dismiss();
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, true);
|
||||
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + packageName));
|
||||
try {
|
||||
mContext.startActivity(intent);
|
||||
} catch (ActivityNotFoundException activityNotFound) {
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, true);
|
||||
} catch (AndroidRuntimeException activityNotFound) {
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
b.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int i) {
|
||||
dialog.cancel();
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, false);
|
||||
}
|
||||
});
|
||||
b.show();
|
||||
}
|
||||
} else {
|
||||
ab.setPref(PREF_CONFIGURE_BATTERY, false);
|
||||
|
@ -33,7 +33,7 @@ tunnel.1.type=ircclient
|
||||
tunnel.1.sharedClient=true
|
||||
tunnel.1.interface=127.0.0.1
|
||||
tunnel.1.listenPort=6668
|
||||
tunnel.1.targetDestination=irc.dg.i2p:6667,irc.postman.i2p:6667,irc.echelon.i2p:6667
|
||||
tunnel.1.targetDestination=irc.postman.i2p:6667,irc.echelon.i2p:6667
|
||||
tunnel.1.i2cpHost=127.0.0.1
|
||||
tunnel.1.i2cpPort=7654
|
||||
tunnel.1.option.inbound.nickname=shared clients
|
||||
|
@ -14,7 +14,7 @@ POM_DEVELOPER_ID=meeh
|
||||
POM_DEVELOPER_NAME=meeh
|
||||
POM_DEVELOPER_EMAIL=meeh@i2pmail.org
|
||||
|
||||
I2P_VERSION=0.9.45
|
||||
I2P_VERSION=0.9.46
|
||||
ANDROID_BUILD_TARGET_SDK_VERSION=28
|
||||
ANDROID_BUILD_SDK_VERSION=28
|
||||
|
||||
|
Reference in New Issue
Block a user