1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-25 09:21:14 +00:00

Added disabled notification

This commit is contained in:
M66B 2015-10-30 10:51:44 +01:00
parent b391275624
commit 5a29bde527
9 changed files with 24 additions and 2 deletions

View file

@ -3,7 +3,6 @@ package eu.faircode.netguard;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;

View file

@ -1,5 +1,6 @@
package eu.faircode.netguard;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
@ -11,6 +12,7 @@ import android.net.ConnectivityManager;
import android.net.VpnService;
import android.os.ParcelFileDescriptor;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.widget.Toast;
@ -269,6 +271,20 @@ public class SinkholeService extends VpnService {
unregisterReceiver(connectivityChangedReceiver);
unregisterReceiver(interactiveStateReceiver);
// Display notification
Intent riMain = new Intent(this, ActivityMain.class);
PendingIntent piMain = PendingIntent.getActivity(this, 0, riMain, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder notification = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.msg_revoked))
.setContentIntent(piMain)
.setAutoCancel(true);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, notification.build());
super.onDestroy();
}

View file

@ -13,6 +13,7 @@
<string name="msg_sure">هل أنت متأكد؟</string>
<string name="msg_disabled">التطبيق غير مُفعّل, قم بتفعيل التطبيق من الخيار أعلاه.</string>
<string name="msg_revoked">NetGuard has been disabled</string>
<string name="title_using">السماح عند استخدام الجهاز</string>
</resources>

View file

@ -13,6 +13,7 @@
<string name="msg_sure">Etes-vous sûr ?</string>
<string name="msg_disabled">NetGuard is disabled, use the switch above to enable NetGuard</string>
<string name="msg_revoked">NetGuard has been disabled</string>
<string name="title_using">Allow when device in use</string>
</resources>

View file

@ -13,6 +13,7 @@
<string name="msg_sure">Sei sicuro?</string>
<string name="msg_disabled">NetGuard è disabilitata, usa lo switch per abilitarlo nuovamente</string>
<string name="msg_revoked">NetGuard has been disabled</string>
<string name="title_using">Consenti quando il dispositivo è in uso</string>
</resources>

View file

@ -13,6 +13,7 @@
<string name="msg_sure">Weet u het zeker?</string>
<string name="msg_disabled">NetGuard staat uit, gebruik de schakelaar bovem om NetGuard aan te zetten</string>
<string name="msg_revoked">NetGuard is uitgezet</string>
<string name="title_using">Sta toe als apparaat in gebruik</string>
</resources>

View file

@ -13,6 +13,7 @@
<string name="msg_sure">Ste si istý?</string>
<string name="msg_disabled">NetGuard je vypnutý, použite prepínač vyššie na zapnutie NetGuard</string>
<string name="msg_revoked">NetGuard has been disabled</string>
<string name="title_using">Povoliť pri používaní zariadenia</string>
</resources>

View file

@ -1,5 +1,5 @@
<resources>
<string name="app_copyright" translatable="false">版权所有 \u00A9 2015 by M. Bokhorst (M66B)</string>
<string name="app_copyright">版权所有 \u00A9 2015 by M. Bokhorst (M66B)</string>
<string name="menu_search">搜索应用</string>
<string name="menu_network">打开网络设置</string>
@ -13,6 +13,7 @@
<string name="msg_sure">是否确认?</string>
<string name="msg_disabled">NetGuard is disabled, use the switch above to enable NetGuard</string>
<string name="msg_revoked">NetGuard has been disabled</string>
<string name="title_using">Allow when device in use</string>
</resources>

View file

@ -14,6 +14,7 @@
<string name="msg_sure">Are you sure?</string>
<string name="msg_disabled">NetGuard is disabled, use the switch above to enable NetGuard</string>
<string name="msg_revoked">NetGuard has been disabled</string>
<string name="title_using">Allow when device in use</string>
</resources>