Compare commits

...

10 Commits

Author SHA1 Message Date
hankhill19580
aec25ab374 update build files for the release 2020-08-26 20:07:21 +00:00
zzz
9d5c495936 remove old subscription 2020-07-04 12:31:16 +00:00
hankhill19580
4dc2bb6b01 check in new string for new foreground task 2020-06-29 23:28:18 +00:00
hankhill19580
373e013911 fix foreground service notification issue on android 8.1 and greater 2020-06-29 20:12:32 +00:00
hankhill19580
83bb7096a7 merge of '412007995e44aa866ff698a168742c4c330a62ef'
and '5bb8ab81cd3ab734f3c6b6d67d53eff28c5f5558'
2020-06-07 16:11:38 +00:00
hankhill19580
69ad581235 update the changelog 2020-06-03 04:51:36 +00:00
hankhill19580
4be227631d Bump version to 0.9.46 2020-06-03 00:20:01 +00:00
hankhill19580
3f3f1f8e3d Catch the AndroidRuntimeException and warn if we can't change the power save permission 2020-06-02 22:40:58 +00:00
hankhill19580
22290da1a4 merge of '01b01ebb27ab903f97975265856546c244185909'
and 'ac15ee2b1ce53342c8bfea5ccd3360220e615471'
2020-03-28 17:16:03 +00:00
zzz
a523e1cb4a update default irc server list 2020-03-04 13:29:13 +00:00
8 changed files with 79 additions and 31 deletions

View File

@@ -1,3 +1,12 @@
0.9.47 2020-8-26
* Notification bug-fixes on platforms >8.0
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

View File

@@ -7,7 +7,7 @@ repositories {
android {
compileSdkVersion 28
defaultConfig {
versionCode 4745256
versionCode 4745257
versionName "$I2P_VERSION"
minSdkVersion 14
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION as String)

View File

@@ -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);

View File

@@ -1,16 +1,23 @@
package net.i2p.android.router.service;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.support.annotation.RequiresApi;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.LocalBroadcastManager;
import net.i2p.android.router.R;
@@ -169,13 +176,41 @@ public class RouterService extends Service {
_handler.removeCallbacks(_updater);
_handler.postDelayed(_updater, 50);
if(!restart) {
startForeground(1337, _statusBar.getNote());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
startOwnForeground();
else
startForeground(1337, _statusBar.getNote());
}
//return START_STICKY;
return START_NOT_STICKY;
}
/**
* Android 8.1, 9.0, 10 handle foreground applications differently and as such require us to
* start our foreground service differently.
* */
@RequiresApi(api = Build.VERSION_CODES.O)
private void startOwnForeground(){
String NOTIFICATION_CHANNEL_ID = "com.example.simpleapp";
String channelName = "My Background Service";
NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_NONE);
chan.setLightColor(Color.BLUE);
chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
assert manager != null;
manager.createNotificationChannel(chan);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
Notification notification = notificationBuilder.setOngoing(true)
.setSmallIcon(R.drawable.i2plogo)
.setContentTitle(getString(R.string.running_background))
.setPriority(NotificationManager.IMPORTANCE_MIN)
.setCategory(Notification.CATEGORY_SERVICE)
.build();
startForeground(1337, notification);
}
/**
* maybe this goes away when the receiver can bind to us
*/

View File

@@ -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

View File

@@ -1,3 +1,2 @@
http://i2p-projekt.i2p/hosts.txt
http://i2host.i2p/cgi-bin/i2hostetag
http://stats.i2p/cgi-bin/newhosts.txt

View File

@@ -415,4 +415,5 @@
<string name="no_market_app">No market app found, please install manually</string>
<string name="unset">Unset</string>
<string name="running_background">I2P is running in the background</string>
</resources>

View File

@@ -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.47
ANDROID_BUILD_TARGET_SDK_VERSION=28
ANDROID_BUILD_SDK_VERSION=28