mirror of https://github.com/M66B/NetGuard.git
parent
7983b03c6c
commit
8c1cbad26e
|
@ -191,6 +191,7 @@ Permissions
|
|||
* RECEIVE_BOOT_COMPLETED ('*Run at startup*'): to start the firewall when booting the device
|
||||
* WAKE_LOCK ('*Prevent device from sleeping*'): to reliably reload rules in the background on connectivity changes
|
||||
* READ/WRITE_EXTERNAL_STORAGE ('*Photos/Media/Files*'): to export/import settings on Android versions before 5.0 (Lollipop) (there is no need to grant this permission on later Android versions)
|
||||
* VIBRATE: to give feedback on widget tap
|
||||
* com.android.vending.BILLING: to use in-app billing
|
||||
|
||||
Support
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<!-- http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous -->
|
||||
|
||||
<uses-feature
|
||||
|
|
|
@ -29,6 +29,7 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.net.VpnService;
|
||||
import android.os.Build;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.widget.RemoteViews;
|
||||
|
@ -60,6 +61,11 @@ public class Widget extends AppWidgetProvider {
|
|||
PendingIntent pi = PendingIntent.getBroadcast(context, 0, new Intent(INTENT_ON), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
am.cancel(pi);
|
||||
|
||||
// Vibrate
|
||||
Vibrator vs = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
if (vs.hasVibrator())
|
||||
vs.vibrate(50);
|
||||
|
||||
if (INTENT_OFF.equals(intent.getAction())) {
|
||||
prefs.edit().putBoolean("enabled", false).apply();
|
||||
ServiceSinkhole.stop("widget", context);
|
||||
|
|
Loading…
Reference in New Issue