Index: res/layout/privacy_options.xml
===================================================================
--- /dev/null
+++ res/layout/privacy_options.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
Index: res/values/strings.xml
===================================================================
--- res/values/strings.xml
+++ res/values/strings.xml
@@ -305,4 +305,9 @@
Required by Android since Android 8.0
Since Android 9.0, this notification can only be minimized by long tapping on it
+ Privacy options
+ Set your privacy options
+ New notification
+ Contents were hidden according to the selected privacy options
+
Index: src/org/kde/kdeconnect/Device.java
===================================================================
--- src/org/kde/kdeconnect/Device.java
+++ src/org/kde/kdeconnect/Device.java
@@ -146,7 +146,7 @@
{
int curBit = option.ordinal();
int bit = privacyOptions & (1 << curBit);
- return bit == 1;
+ return bit != 0;
}
}
Index: src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java
===================================================================
--- src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java
+++ src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java
@@ -253,14 +253,14 @@
}
np.set("id", key);
- np.set("appName", appName == null ? packageName : appName);
np.set("isClearable", statusBarNotification.isClearable());
if(device.privacyOptions.getOption(Device.PrivacyOptions.Options.BLOCK_CONTENTS)) {
+ np.set("appName", context.getResources().getString(R.string.new_notification));
np.set("ticker", "");
- np.set("title", "");
+ np.set("title", context.getResources().getString(R.string.hidden_contents));
np.set("text", "");
- }
- else {
+ } else {
+ np.set("appName", appName == null ? packageName : appName);
np.set("ticker", getTickerText(notification));
np.set("title", getNotificationTitle(notification));
np.set("text", getNotificationText(notification));
Index: src/org/kde/kdeconnect/UserInterface/DeviceFragment.java
===================================================================
--- src/org/kde/kdeconnect/UserInterface/DeviceFragment.java
+++ src/org/kde/kdeconnect/UserInterface/DeviceFragment.java
@@ -211,11 +211,15 @@
View mView = getLayoutInflater().inflate(R.layout.privacy_options, null);
CheckBox checkbox_contents = mView.findViewById(R.id.checkbox_contents);
+ checkbox_contents.setChecked(device.privacyOptions.getOption(Device.PrivacyOptions.Options.BLOCK_CONTENTS));
+
CheckBox checkbox_images = mView.findViewById(R.id.checkbox_images);
+ checkbox_images.setChecked(device.privacyOptions.getOption(Device.PrivacyOptions.Options.BLOCK_IMAGES));
+
builder.setView(mView);
- builder.setTitle("Privacy options");
+ builder.setTitle(context.getResources().getString(R.string.privacy_options));
builder.setPositiveButton(context.getResources().getString(R.string.ok), (dialog, id) -> dialog.dismiss());
- builder.setMessage("Choose your privacy options");
+ builder.setMessage(context.getResources().getString(R.string.set_privacy_options));
checkbox_contents.setOnCheckedChangeListener((compoundButton, b) ->
device.privacyOptions.setOption(Device.PrivacyOptions.Options.BLOCK_CONTENTS,