diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java index baa3a5d04..6a24e7c28 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java @@ -358,9 +358,7 @@ public class CallNotificationController extends BaseController { playRingtoneSound(); } - if (DoNotDisturbUtils.INSTANCE.shouldVibrate(appPreferences.getShouldVibrateSetting())) { - vibrate(); - } + vibrate(); } @Subscribe(threadMode = ThreadMode.MAIN) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java index a0035bdce..1f369c0d7 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java @@ -170,8 +170,6 @@ public class SettingsController extends BaseController { MaterialPreferenceCategory messageView; @BindView(R.id.settings_client_cert) MaterialStandardPreference certificateSetup; - @BindView(R.id.settings_always_vibrate) - MaterialSwitchPreference shouldVibrateSwitchPreference; @BindView(R.id.settings_incognito_keyboard) MaterialSwitchPreference incognitoKeyboardSwitchPreference; @BindView(R.id.settings_screen_security) @@ -263,10 +261,6 @@ public class SettingsController extends BaseController { licenceButton.setVisibility(View.GONE); } - if (!DoNotDisturbUtils.INSTANCE.hasVibrator()) { - shouldVibrateSwitchPreference.setVisibility(View.GONE); - } - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { incognitoKeyboardSwitchPreference.setVisibility(View.GONE); } @@ -280,7 +274,6 @@ public class SettingsController extends BaseController { getResources().getString(R.string.nc_app_product_name))); } - if (!TextUtils.isEmpty(getResources().getString(R.string.nc_privacy_url))) { privacyButton.addPreferenceClickListener(view12 -> { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources(). @@ -353,7 +346,6 @@ public class SettingsController extends BaseController { alias = ""; } - userUtils.createOrUpdateUser(null, null, null, null, null, null, null, currentUser.getId(), null, alias, null); }, new String[]{"RSA", "EC"}, null, finalHost, finalPort, currentUser.getClientCertificate @@ -445,10 +437,6 @@ public class SettingsController extends BaseController { certificateSetup.setTitle(R.string.nc_client_cert_setup); } - if (shouldVibrateSwitchPreference.getVisibility() == View.VISIBLE) { - ((Checkable) shouldVibrateSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getShouldVibrateSetting()); - } - ((Checkable) screenSecuritySwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getIsScreenSecured()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ((Checkable) incognitoKeyboardSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getIsKeyboardIncognito()); diff --git a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java index 587b82ae0..74496da80 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java @@ -537,18 +537,15 @@ public class NotificationWorker extends Worker { } } - - if (DoNotDisturbUtils.INSTANCE.shouldVibrate(appPreferences.getShouldVibrateSetting()) || importantConversation) { - Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); - - if (vibrator != null) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - //vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE)); - } else { - //vibrator.vibrate(500); - } + Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); + if (vibrator != null) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + //vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE)); + } else { + //vibrator.vibrate(500); } } + } } diff --git a/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferences.java b/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferences.java index cb7398309..30d725f91 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferences.java +++ b/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferences.java @@ -187,17 +187,6 @@ public interface AppPreferences { @RemoveMethod void removeNotificationChannelUpgradeToV3(); - @KeyByString("notifications_vibrate") - @DefaultValue(R.bool.value_true) - boolean getShouldVibrateSetting(); - - @KeyByString("notifications_vibrate") - void setVibrateSetting(boolean value); - - @KeyByString("notifications_vibrate") - @RemoveMethod - void removeVibrateSetting(); - @KeyByString("screen_security") @DefaultValue(R.bool.value_false) boolean getIsScreenSecured();