1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-01 14:32:54 +01:00

Reworking notification management

- rename some methods to better indicate their functions.
- make the notification filter to be allow or deny list,
  solves #2256 and #336
- make app word filter to behave based on allow/deny settings.
- make Pebble notifications to honor the allow/deny settings.
- add generic "debug function" to Debug activity.
- add Message privacy mode settings, solves #2279
This commit is contained in:
vanous 2021-09-26 21:59:11 +02:00
parent 9ad7e210b7
commit d3d4130a95
19 changed files with 385 additions and 181 deletions

View File

@ -114,7 +114,7 @@
android:parentActivityName=".activities.ControlCenterv2" />
<activity
android:name=".activities.AppBlacklistActivity"
android:label="@string/title_activity_appblacklist"
android:label="@string/title_activity_notification_management"
android:parentActivityName=".activities.SettingsActivity" />
<activity
android:name=".activities.CalBlacklistActivity"
@ -447,6 +447,11 @@
android:label="@string/title_activity_db_management"
android:parentActivityName=".activities.ControlCenterv2"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".activities.NotificationManagementActivity"
android:label="@string/title_activity_notification_management"
android:parentActivityName=".activities.ControlCenterv2"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".activities.DiscoveryActivity"
android:label="@string/title_activity_discovery"

View File

@ -361,6 +361,11 @@ public class GBApplication extends Application {
return VERSION.SDK_INT >= Build.VERSION_CODES.O;
}
public static boolean isRunningTenOrLater() {
return VERSION.SDK_INT >= Build.VERSION_CODES.Q;
}
public static boolean isRunningPieOrLater() {
return VERSION.SDK_INT >= Build.VERSION_CODES.P;
}

View File

@ -79,11 +79,11 @@ public class AppBlacklistActivity extends AbstractGBActivity {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
case R.id.blacklist_all_notif:
appBlacklistAdapter.blacklistAllNotif();
case R.id.check_all_applications:
appBlacklistAdapter.checkAllApplications();
return true;
case R.id.whitelist_all_notif:
appBlacklistAdapter.whitelistAllNotif();
case R.id.uncheck_all_applications:
appBlacklistAdapter.uncheckAllApplications();
return true;
}
return super.onOptionsItemSelected(item);

View File

@ -307,8 +307,8 @@ public class ControlCenterv2 extends AppCompatActivity
Intent dbIntent = new Intent(this, DataManagementActivity.class);
startActivity(dbIntent);
return true;
case R.id.action_blacklist:
Intent blIntent = new Intent(this, AppBlacklistActivity.class);
case R.id.action_notification_management:
Intent blIntent = new Intent(this, NotificationManagementActivity.class);
startActivity(blIntent);
return true;
case R.id.device_action_discover:

View File

@ -410,6 +410,15 @@ public class DebugActivity extends AbstractGBActivity {
}
});
Button runDebugFunction = findViewById(R.id.runDebugFunction);
runDebugFunction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//SharedPreferences.Editor editor = GBApplication.getPrefs().getPreferences().edit();
//editor.remove("notification_list_is_blacklist").apply();
}
});
Button addDeviceButtonDebug = findViewById(R.id.addDeviceButtonDebug);
addDeviceButtonDebug.setOnClickListener(new View.OnClickListener() {
@Override

View File

@ -0,0 +1,144 @@
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo,
vanous
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo,
vanous
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.activities;
import android.content.Intent;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceCategory;
import android.preference.PreferenceManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.database.PeriodicExporter;
import nodomain.freeyourgadget.gadgetbridge.util.GBPrefs;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public class NotificationManagementActivity extends AbstractSettingsActivity {
private static final Logger LOG = LoggerFactory.getLogger(NotificationManagementActivity.class);
private static final int RINGTONE_REQUEST_CODE = 4712;
private static final String DEFAULT_RINGTONE_URI = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE).toString();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.notifications_preferences);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
Prefs prefs = GBApplication.getPrefs();
Preference pref = findPreference("notifications_generic");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent enableIntent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
startActivity(enableIntent);
return true;
}
});
pref = findPreference(GBPrefs.PING_TONE);
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Set Ping tone");
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_ALL);
startActivityForResult(intent, RINGTONE_REQUEST_CODE);
return true;
}
});
pref.setSummary(RingtoneManager.getRingtone(this, Uri.parse(prefs.getString(GBPrefs.PING_TONE, DEFAULT_RINGTONE_URI))).getTitle(this));
pref = findPreference("pref_key_blacklist");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent enableIntent = new Intent(NotificationManagementActivity.this, AppBlacklistActivity.class);
startActivity(enableIntent);
return true;
}
});
if (!GBApplication.isRunningMarshmallowOrLater()) {
pref = findPreference("notification_filter");
PreferenceCategory category = (PreferenceCategory) findPreference("pref_key_notifications");
category.removePreference(pref);
}
if (GBApplication.isRunningTenOrLater()) {
pref = findPreference("minimize_priority");
PreferenceCategory category = (PreferenceCategory) findPreference("pref_key_notifications");
category.removePreference(pref);
}
}
@Override
protected String[] getPreferenceKeysWithSummary() {
return new String[]{
};
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == RINGTONE_REQUEST_CODE && intent != null) {
if (intent.getExtras().getParcelable(RingtoneManager.EXTRA_RINGTONE_PICKED_URI) != null) {
Uri uri = intent.getExtras().getParcelable(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
Ringtone r = RingtoneManager.getRingtone(this, uri);
findPreference(GBPrefs.PING_TONE).setSummary(r.toString());
PreferenceManager
.getDefaultSharedPreferences(this)
.edit()
.putString(GBPrefs.PING_TONE, uri.toString())
.apply();
findPreference(GBPrefs.PING_TONE).setSummary(r.getTitle(this));
}
}
}
}

View File

@ -73,8 +73,6 @@ public class SettingsActivity extends AbstractSettingsActivity {
public static final String PREF_MEASUREMENT_SYSTEM = "measurement_system";
private static final int FILE_REQUEST_CODE = 4711;
private static final int RINGTONE_REQUEST_CODE = 4712;
private static final String DEFAULT_RINGTONE_URI = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE).toString();
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -87,17 +85,7 @@ public class SettingsActivity extends AbstractSettingsActivity {
super.onPostCreate(savedInstanceState);
Prefs prefs = GBApplication.getPrefs();
Preference pref = findPreference("notifications_generic");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent enableIntent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
startActivity(enableIntent);
return true;
}
});
pref = findPreference("pref_category_activity_personal");
Preference pref = findPreference("pref_category_activity_personal");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent enableIntent = new Intent(SettingsActivity.this, AboutUserPreferencesActivity.class);
@ -143,15 +131,6 @@ public class SettingsActivity extends AbstractSettingsActivity {
}
});
pref = findPreference("pref_key_blacklist");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent enableIntent = new Intent(SettingsActivity.this, AppBlacklistActivity.class);
startActivity(enableIntent);
return true;
}
});
pref = findPreference("pref_key_blacklist_calendars");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
@ -244,12 +223,6 @@ public class SettingsActivity extends AbstractSettingsActivity {
}
});
if (!GBApplication.isRunningMarshmallowOrLater()) {
pref = findPreference("notification_filter");
PreferenceCategory category = (PreferenceCategory) findPreference("pref_key_notifications");
category.removePreference(pref);
}
pref = findPreference("location_aquire");
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
@ -309,20 +282,6 @@ public class SettingsActivity extends AbstractSettingsActivity {
}
});
pref = findPreference(GBPrefs.PING_TONE);
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Set Ping tone");
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_ALL);
startActivityForResult(intent, RINGTONE_REQUEST_CODE);
return true;
}
});
pref.setSummary(RingtoneManager.getRingtone(this, Uri.parse(prefs.getString(GBPrefs.PING_TONE, DEFAULT_RINGTONE_URI))).getTitle(this));
pref = findPreference(GBPrefs.AUTO_EXPORT_LOCATION);
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@ -455,20 +414,6 @@ public class SettingsActivity extends AbstractSettingsActivity {
.getPrefs().getInt(GBPrefs.AUTO_EXPORT_INTERVAL, 0);
PeriodicExporter.sheduleAlarm(getApplicationContext(), autoExportPeriod, autoExportEnabled);
}
if (requestCode == RINGTONE_REQUEST_CODE && intent != null) {
if(intent.getExtras().getParcelable(RingtoneManager.EXTRA_RINGTONE_PICKED_URI)!= null){
Uri uri = intent.getExtras().getParcelable(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
Ringtone r = RingtoneManager.getRingtone(this ,uri);
findPreference(GBPrefs.PING_TONE).setSummary(r.toString());
PreferenceManager
.getDefaultSharedPreferences(this)
.edit()
.putString(GBPrefs.PING_TONE, uri.toString())
.apply();
findPreference(GBPrefs.PING_TONE).setSummary(r.getTitle(this));
}
}
}
/*

View File

@ -137,18 +137,28 @@ public class AppBlacklistAdapter extends RecyclerView.Adapter<AppBlacklistAdapte
@Override
public void onClick(View view) {
if (GBApplication.getPrefs().getString("notification_list_is_blacklist", "true").equals("true")) {
if (holder.blacklist_checkbox.isChecked()) {
GB.toast(mContext, mContext.getString(R.string.toast_app_must_not_be_blacklisted), Toast.LENGTH_SHORT, GB.INFO);
GB.toast(mContext, mContext.getString(R.string.toast_app_must_not_be_selected), Toast.LENGTH_SHORT, GB.INFO);
} else {
Intent intentStartNotificationFilterActivity = new Intent(mContext, NotificationFilterActivity.class);
intentStartNotificationFilterActivity.putExtra(STRING_EXTRA_PACKAGE_NAME, appInfo.packageName);
mContext.startActivity(intentStartNotificationFilterActivity);
}
} else {
if (holder.blacklist_checkbox.isChecked()) {
Intent intentStartNotificationFilterActivity = new Intent(mContext, NotificationFilterActivity.class);
intentStartNotificationFilterActivity.putExtra(STRING_EXTRA_PACKAGE_NAME, appInfo.packageName);
mContext.startActivity(intentStartNotificationFilterActivity);
} else {
GB.toast(mContext, mContext.getString(R.string.toast_app_must_be_selected), Toast.LENGTH_SHORT, GB.INFO);
}
}
}
});
}
public void blacklistAllNotif() {
public void checkAllApplications() {
Set<String> apps_blacklist = new HashSet<>();
List<ApplicationInfo> allApps = mPm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo ai : allApps) {
@ -158,7 +168,7 @@ public class AppBlacklistAdapter extends RecyclerView.Adapter<AppBlacklistAdapte
notifyDataSetChanged();
}
public void whitelistAllNotif() {
public void uncheckAllApplications() {
Set<String> apps_blacklist = new HashSet<>();
GBApplication.setAppsNotifBlackList(apps_blacklist);
notifyDataSetChanged();

View File

@ -168,9 +168,12 @@ public class NotificationListener extends NotificationListenerService {
LOG.info("could not lookup handle for mute action");
break;
}
LOG.info("going to mute " + packageName);
if (GBApplication.getPrefs().getString("notification_list_is_blacklist", "true").equals("true")) {
GBApplication.addAppToNotifBlacklist(packageName);
} else {
GBApplication.removeFromAppsNotifBlacklist(packageName);
}
break;
case ACTION_DISMISS: {
StatusBarNotification[] sbns = NotificationListener.this.getActiveNotifications();
@ -263,11 +266,13 @@ public class NotificationListener extends NotificationListenerService {
@Override
public void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) {
logNotification(sbn, true);
LOG.debug("notificationAppListIsBlackList: " + GBApplication.getPrefs().getString("notification_list_is_blacklist","true"));
notificationStack.remove(sbn.getPackageName());
notificationStack.add(sbn.getPackageName());
if (shouldIgnoreNotifications()) return;
if (isServiceNotRunningAndShouldIgnoreNotifications()) return;
if (shouldIgnoreSource(sbn)) {
LOG.debug("Ignoring notification source");
@ -716,7 +721,7 @@ public class NotificationListener extends NotificationListenerService {
notificationStack.remove(sbn.getPackageName());
if (shouldIgnoreNotifications()) return;
if (isServiceNotRunningAndShouldIgnoreNotifications()) return;
if (shouldIgnoreSource(sbn)) return;
if (handleMediaSessionNotification(sbn)) return;
@ -790,7 +795,7 @@ public class NotificationListener extends NotificationListenerService {
}
private boolean shouldIgnoreNotifications() {
private boolean isServiceNotRunningAndShouldIgnoreNotifications() {
/*
* return early if DeviceCommunicationService is not running,
* else the service would get started every time we get a notification.
@ -834,10 +839,20 @@ public class NotificationListener extends NotificationListenerService {
}
}
if (GBApplication.getPrefs().getString("notification_list_is_blacklist", "true").equals("true")) {
if (GBApplication.appIsNotifBlacklisted(source)) {
LOG.info("Ignoring notification, application is blacklisted");
return true;
}
} else {
if (GBApplication.appIsNotifBlacklisted(source)) {
LOG.info("Allowing notification, application is whitelisted");
return false;
} else {
LOG.info("Ignoring notification, application is not whitelisted");
return true;
}
}
return false;
}

View File

@ -76,10 +76,17 @@ public class PebbleReceiver extends BroadcastReceiver {
if (notificationSpec.title != null) {
notificationSpec.type = NotificationType.UNKNOWN;
String sender = intent.getStringExtra("sender");
if (GBApplication.getPrefs().getString("notification_list_is_blacklist", "true").equals("true")) {
if (GBApplication.appIsPebbleBlacklisted(sender)) {
LOG.info("Ignoring Pebble message, application " + sender + " is blacklisted");
return;
}
} else {
if (!GBApplication.appIsPebbleBlacklisted(sender)) {
LOG.info("Ignoring Pebble message, application " + sender + " is not whitelisted");
return;
}
}
if ("Conversations".equals(sender)) {
notificationSpec.type = NotificationType.CONVERSATIONS;

View File

@ -138,13 +138,17 @@ public class GBDeviceService implements DeviceService {
@Override
public void onNotification(NotificationSpec notificationSpec) {
boolean hideMessageDetails = GBApplication.getPrefs().getString("pref_message_privacy_mode",
GBApplication.getContext().getString(R.string.p_message_privacy_mode_off))
.equals(GBApplication.getContext().getString(R.string.p_message_privacy_mode_complete));
Intent intent = createIntent().setAction(ACTION_NOTIFICATION)
.putExtra(EXTRA_NOTIFICATION_FLAGS, notificationSpec.flags)
.putExtra(EXTRA_NOTIFICATION_PHONENUMBER, notificationSpec.phoneNumber)
.putExtra(EXTRA_NOTIFICATION_SENDER, coalesce(notificationSpec.sender, getContactDisplayNameByNumber(notificationSpec.phoneNumber)))
.putExtra(EXTRA_NOTIFICATION_SUBJECT, notificationSpec.subject)
.putExtra(EXTRA_NOTIFICATION_TITLE, notificationSpec.title)
.putExtra(EXTRA_NOTIFICATION_BODY, notificationSpec.body)
.putExtra(EXTRA_NOTIFICATION_PHONENUMBER, hideMessageDetails ? null : notificationSpec.phoneNumber)
.putExtra(EXTRA_NOTIFICATION_SENDER, hideMessageDetails ? null : coalesce(notificationSpec.sender, getContactDisplayNameByNumber(notificationSpec.phoneNumber)))
.putExtra(EXTRA_NOTIFICATION_SUBJECT, hideMessageDetails ? null : notificationSpec.subject)
.putExtra(EXTRA_NOTIFICATION_TITLE, hideMessageDetails ? null : notificationSpec.title)
.putExtra(EXTRA_NOTIFICATION_BODY, hideMessageDetails ? null : notificationSpec.body)
.putExtra(EXTRA_NOTIFICATION_ID, notificationSpec.getId())
.putExtra(EXTRA_NOTIFICATION_TYPE, notificationSpec.type)
.putExtra(EXTRA_NOTIFICATION_ACTIONS, notificationSpec.attachedActions)

View File

@ -225,6 +225,14 @@
grid:layout_columnSpan="2"
grid:layout_gravity="fill_horizontal" />
<Button
android:id="@+id/runDebugFunction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Run Debug Function"
grid:layout_columnSpan="2"
grid:layout_gravity="fill_horizontal" />
</androidx.gridlayout.widget.GridLayout>
</ScrollView>

View File

@ -13,9 +13,9 @@
<item android:id="@+id/action_data_management"
android:title="@string/action_db_management"
android:icon="@drawable/ic_pageview" />
<item android:id="@+id/action_blacklist"
android:title="@string/title_activity_appblacklist"
android:icon="@drawable/ic_block" />
<item android:id="@+id/action_notification_management"
android:title="@string/title_activity_notification_management"
android:icon="@drawable/ic_notifications" />
<item android:id="@+id/device_action_discover"
android:title="@string/action_discover"
android:iconTint="#7E7E7E"

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/blacklist_all_notif"
android:title="@string/blacklist_all_for_notifications">
android:id="@+id/check_all_applications"
android:title="@string/check_all_applications">
</item>
<item
android:id="@+id/whitelist_all_notif"
android:title="@string/whitelist_all_for_notifications" />
android:id="@+id/uncheck_all_applications"
android:title="@string/uncheck_all_applications" />
</menu>

View File

@ -1268,6 +1268,17 @@
<item>@string/p_call_privacy_mode_complete</item>
</string-array>
<string-array name="pref_message_privacy_mode">
<item name="off">@string/pref_message_privacy_mode_off</item>
<item name="complete">@string/pref_message_privacy_mode_complete</item>
</string-array>
<string-array name="pref_message_privacy_mode_values">
<item>@string/p_message_privacy_mode_off</item>
<item>@string/p_message_privacy_mode_complete</item>
</string-array>
<string-array name="pref_language_all">
<item name="auto">@string/automatic</item>
<item name="zh_CN">@string/simplified_chinese</item>
@ -1766,5 +1777,16 @@
<item>transparency</item>
<item>off</item>
</string-array>
<string-array name="notification_list_is_blacklist_names">
<item>@string/pref_title_notification_use_as_deny</item>
<item>@string/pref_title_notification_use_as_allow</item>
</string-array>
<string-array name="notification_list_is_blacklist_values">
<item>true</item>
<item>false</item>
</string-array>
</resources>

View File

@ -58,9 +58,11 @@
<string name="app_configure">Configure</string>
<string name="app_move_to_top">Move to top</string>
<!-- Strings related to AppBlacklist -->
<string name="title_activity_appblacklist">Notification blacklist</string>
<string name="title_activity_notification_management">Notification settings</string>
<string name="blacklist_all_for_notifications">Blacklist all for notifications</string>
<string name="whitelist_all_for_notifications">Whitelist all for notifications</string>
<string name="check_all_applications">Check all applications</string>
<string name="uncheck_all_applications">Uncheck all applications</string>
<!-- Strings related to CalBlacklist -->
<string name="title_activity_calblacklist">Blacklisted Calendars</string>
<!-- Strings related to FwAppInstaller -->
@ -129,6 +131,10 @@
<string name="pref_title_whenscreenon">…also when screen is on</string>
<string name="pref_title_notification_filter">Do Not Disturb</string>
<string name="pref_summary_notification_filter">Unwanted notifications are stopped in this mode</string>
<string name="pref_header_notification_application_settings">Per application settings</string>
<string name="pref_title_notification_use_as">Use the Applications list to...</string>
<string name="pref_title_notification_use_as_deny">Deny notifications from selected apps</string>
<string name="pref_title_notification_use_as_allow">Allow notifications from selected apps</string>
<string name="pref_title_transliteration">Transliteration</string>
<string name="pref_summary_transliteration">Enable this if your device has no support for your language\'s font</string>
<string name="pref_title_rtl">Right-To-Left</string>
@ -144,10 +150,13 @@
<string name="pref_call_privacy_mode_name">Hide name but display number</string>
<string name="pref_call_privacy_mode_number">Hide number but display name</string>
<string name="pref_call_privacy_mode_complete">Hide name and number</string>
<string name="pref_title_message_privacy_mode">Message privacy mode</string>
<string name="pref_message_privacy_mode_off">Display content</string>
<string name="pref_message_privacy_mode_complete">Hide content</string>
<string name="pref_title_weather">Weather</string>
<string name="pref_title_weather_location">Weather location (for LineageOS weather provider)</string>
<string name="pref_title_weather_summary">Used for the LineageOS weather provider, other Android versions need to use an app like \"Weather notification\". Find more information in the Gadgetbridge wiki.</string>
<string name="pref_blacklist">Blacklist Apps</string>
<string name="pref_applications_settings">Applications list</string>
<string name="pref_blacklist_calendars">Blacklist Calendars</string>
<string name="pref_header_cannned_messages">Canned messages</string>
<string name="pref_title_canned_replies">Replies</string>
@ -949,7 +958,8 @@
<string name="language_and_region_prefs">Language and region settings</string>
<!--Notification Filter Black-/ Whitelist-->
<string name="title_activity_notification_filter">Notification Filter</string>
<string name="toast_app_must_not_be_blacklisted">App must not be blacklisted to be configured</string>
<string name="toast_app_must_not_be_selected">App must not be selected to be configured</string>
<string name="toast_app_must_be_selected">App must be selected to be configured</string>
<string name="edittext_notification_filter_words_hint">Enter desired words, new line for each</string>
<string name="toast_notification_filter_saved_successfully">Notification filter saved</string>
<string name="filter_mode_none">Do not filter</string>

View File

@ -92,4 +92,7 @@
<item name="p_speed_zones" type="string">speedzones</item>
<item name="p_live_stats" type="string">livestats</item>
<item name="p_message_privacy_mode_off" type="string">off</item>
<item name="p_message_privacy_mode_complete" type="string">complete</item>
</resources>

View File

@ -0,0 +1,102 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="pref_key_notifications"
android:title="@string/pref_header_notifications">
<Preference
android:key="notifications_generic"
android:title="@string/pref_title_notifications_generic" />
<CheckBoxPreference
android:defaultValue="false"
android:key="notifications_generic_whenscreenon"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_title_whenscreenon" />
<CheckBoxPreference
android:defaultValue="false"
android:key="minimize_priority"
android:layout="@layout/preference_checkbox"
android:summaryOff="@string/pref_summary_minimize_priority_off"
android:summaryOn="@string/pref_summary_minimize_priority_on"
android:title="@string/pref_title_minimize_priority" />
<Preference
android:id="@+id/preference"
android:key="ping_tone"
android:title="@string/pref_title_ping_tone"
app:summary="%s" />
<ListPreference
android:defaultValue="always"
android:entries="@array/notification_mode_toggle"
android:entryValues="@array/notification_mode_values_toggle"
android:key="notification_mode_calls"
android:summary="%s"
android:title="@string/pref_title_notifications_call" />
<CheckBoxPreference
android:defaultValue="false"
android:key="notification_support_voip_calls"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_title_support_voip_calls" />
<ListPreference
android:defaultValue="when_screen_off"
android:entries="@array/notification_mode"
android:entryValues="@array/notification_mode_values"
android:key="notification_mode_sms"
android:summary="%s"
android:title="@string/pref_title_notifications_sms" />
<ListPreference
android:defaultValue="when_screen_off"
android:entries="@array/notification_mode"
android:entryValues="@array/notification_mode_values"
android:key="notification_mode_pebblemsg"
android:summary="@string/pref_summary_notifications_pebblemsg"
android:title="@string/pref_title_notifications_pebblemsg" />
<ListPreference
android:defaultValue="0"
android:entries="@array/notifications_timeout"
android:entryValues="@array/notifications_timeout_values"
android:key="notifications_timeout"
android:summary="%s"
android:title="@string/pref_title_notifications_timeout" />
<CheckBoxPreference
android:defaultValue="false"
android:key="notification_filter"
android:layout="@layout/preference_checkbox"
android:summary="@string/pref_summary_notification_filter"
android:title="@string/pref_title_notification_filter" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_header_notification_application_settings">
<ListPreference
android:defaultValue="true"
android:entries="@array/notification_list_is_blacklist_names"
android:entryValues="@array/notification_list_is_blacklist_values"
android:key="notification_list_is_blacklist"
android:summary="%s"
android:title="@string/pref_title_notification_use_as" />
<Preference
android:key="pref_key_blacklist"
android:title="@string/pref_applications_settings" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_header_privacy">
<ListPreference
android:defaultValue="@string/p_call_privacy_mode_off"
android:entries="@array/pref_call_privacy_mode"
android:entryValues="@array/pref_call_privacy_mode_values"
android:key="pref_call_privacy_mode"
android:summary="%s"
android:title="@string/pref_title_call_privacy_mode" />
<ListPreference
android:defaultValue="off"
android:entries="@array/pref_message_privacy_mode"
android:entryValues="@array/pref_message_privacy_mode_values"
android:key="pref_message_privacy_mode"
android:summary="%s"
android:title="@string/pref_title_message_privacy_mode" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -99,13 +99,6 @@
android:title="@string/pref_title_weather_location" />
</PreferenceScreen>
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="minimize_priority"
android:summaryOff="@string/pref_summary_minimize_priority_off"
android:summaryOn="@string/pref_summary_minimize_priority_on"
android:title="@string/pref_title_minimize_priority" />
</PreferenceCategory>
<Preference
@ -126,84 +119,6 @@
android:summary="@string/pref_summary_datetime_syctimeonconnect"
android:title="@string/pref_title_datetime_syctimeonconnect" />
</PreferenceCategory>
<PreferenceCategory
android:key="pref_key_notifications"
android:title="@string/pref_header_notifications">
<Preference
android:id="@+id/preference"
android:key="ping_tone"
android:title="@string/pref_title_ping_tone"
app:summary="%s" />
<ListPreference
android:defaultValue="always"
android:entries="@array/notification_mode_toggle"
android:entryValues="@array/notification_mode_values_toggle"
android:key="notification_mode_calls"
android:title="@string/pref_title_notifications_call"
android:summary="%s" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="notification_support_voip_calls"
android:title="@string/pref_title_support_voip_calls" />
<ListPreference
android:defaultValue="when_screen_off"
android:entries="@array/notification_mode"
android:entryValues="@array/notification_mode_values"
android:key="notification_mode_sms"
android:title="@string/pref_title_notifications_sms"
android:summary="%s" />
<ListPreference
android:defaultValue="when_screen_off"
android:entries="@array/notification_mode"
android:entryValues="@array/notification_mode_values"
android:key="notification_mode_pebblemsg"
android:summary="@string/pref_summary_notifications_pebblemsg"
android:title="@string/pref_title_notifications_pebblemsg" />
<Preference
android:key="notifications_generic"
android:title="@string/pref_title_notifications_generic" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="notifications_generic_whenscreenon"
android:title="@string/pref_title_whenscreenon" />
<ListPreference
android:defaultValue="0"
android:entries="@array/notifications_timeout"
android:entryValues="@array/notifications_timeout_values"
android:key="notifications_timeout"
android:title="@string/pref_title_notifications_timeout"
android:summary="%s" />
<CheckBoxPreference
android:layout="@layout/preference_checkbox"
android:defaultValue="false"
android:key="notification_filter"
android:summary="@string/pref_summary_notification_filter"
android:title="@string/pref_title_notification_filter" />
<Preference
android:key="pref_key_blacklist"
android:title="@string/pref_blacklist" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_header_privacy">
<ListPreference
android:defaultValue="@string/p_call_privacy_mode_off"
android:key="pref_call_privacy_mode"
android:title="@string/pref_title_call_privacy_mode"
android:entries="@array/pref_call_privacy_mode"
android:entryValues="@array/pref_call_privacy_mode_values"
android:summary="%s" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/preferences_category_device_specific_settings">