-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toggle IP address visibility (PSG-860) #7546
Changes from 16 commits
456762a
eed2a74
b5e8375
0868869
f6bc28f
8bc7000
e888c11
46c60f5
b81fc4f
6f997e8
202c0c5
f63c6c3
c788dea
6c45490
ab749ee
5eb786b
abea9b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[Device Manager] Toggle IP address visibility |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,6 +209,9 @@ class VectorPreferences @Inject constructor( | |
private const val SETTINGS_SECURITY_USE_GRACE_PERIOD_FLAG = "SETTINGS_SECURITY_USE_GRACE_PERIOD_FLAG" | ||
const val SETTINGS_SECURITY_USE_COMPLETE_NOTIFICATIONS_FLAG = "SETTINGS_SECURITY_USE_COMPLETE_NOTIFICATIONS_FLAG" | ||
|
||
// New Session Manager | ||
const val SETTINGS_SESSION_MANAGER_SHOW_IP_ADDRESS = "SETTINGS_SESSION_MANAGER_SHOW_IP_ADDRESS" | ||
|
||
// other | ||
const val SETTINGS_MEDIA_SAVING_PERIOD_KEY = "SETTINGS_MEDIA_SAVING_PERIOD_KEY" | ||
private const val SETTINGS_MEDIA_SAVING_PERIOD_SELECTED_KEY = "SETTINGS_MEDIA_SAVING_PERIOD_SELECTED_KEY" | ||
|
@@ -1228,4 +1231,14 @@ class VectorPreferences @Inject constructor( | |
return vectorFeatures.isVoiceBroadcastEnabled() && | ||
defaultPrefs.getBoolean(SETTINGS_LABS_VOICE_BROADCAST_KEY, getDefault(R.bool.settings_labs_enable_voice_broadcast_default)) | ||
} | ||
|
||
fun showIpAddressInDeviceManagerScreens(): Boolean { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small question about naming, should we align the methods and preference setting names on |
||
return defaultPrefs.getBoolean(SETTINGS_SESSION_MANAGER_SHOW_IP_ADDRESS, getDefault(R.bool.settings_device_manager_show_ip_address)) | ||
} | ||
|
||
fun setIpAddressVisibilityInDeviceManagerScreens(isVisible: Boolean) { | ||
defaultPrefs.edit { | ||
putBoolean(VectorPreferences.SETTINGS_SESSION_MANAGER_SHOW_IP_ADDRESS, isVisible) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2022 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.features.settings.devices.v2 | ||
|
||
import im.vector.app.features.settings.VectorPreferences | ||
import javax.inject.Inject | ||
|
||
class ToggleIpAddressVisibilityUseCase @Inject constructor( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add unit tests for this new use case. |
||
private val vectorPreferences: VectorPreferences, | ||
) { | ||
|
||
fun execute() { | ||
val currentVisibility = vectorPreferences.showIpAddressInDeviceManagerScreens() | ||
vectorPreferences.setIpAddressVisibilityInDeviceManagerScreens(!currentVisibility) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the default value here. But I think it should not be in the labs section, maybe in a new section
Level 3: Security & Privacy, Sessions
?