mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 06:35:48 +03:00
add sendFilesSupport configs to the MDM
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
e9054e1a05
commit
60bcb92cd9
2 changed files with 13 additions and 2 deletions
|
@ -11,6 +11,7 @@ import android.content.Context
|
|||
import com.nextcloud.utils.extensions.getRestriction
|
||||
import com.owncloud.android.BuildConfig
|
||||
import com.owncloud.android.R
|
||||
import com.owncloud.android.files.FileMenuFilter
|
||||
import com.owncloud.android.utils.appConfig.AppConfigKeys
|
||||
|
||||
object MDMConfig {
|
||||
|
@ -47,6 +48,17 @@ object MDMConfig {
|
|||
return shareViaUsers && disableShareViaMDM
|
||||
}
|
||||
|
||||
fun sendFilesSupport(context: Context): Boolean {
|
||||
val disableShareViaMDM = context.getRestriction(
|
||||
AppConfigKeys.DisableSharing,
|
||||
context.resources.getBoolean(R.bool.disable_sharing)
|
||||
)
|
||||
|
||||
val sendFilesToOtherApp = "on".equals(context.getString(R.string.send_files_to_other_apps), ignoreCase = true)
|
||||
|
||||
return sendFilesToOtherApp && !disableShareViaMDM
|
||||
}
|
||||
|
||||
fun clipBoardSupport(context: Context): Boolean {
|
||||
val disableClipboardSupport = context.getRestriction(
|
||||
AppConfigKeys.DisableClipboard,
|
||||
|
|
|
@ -188,8 +188,7 @@ public class FileMenuFilter {
|
|||
}
|
||||
|
||||
private void filterSendFiles(List<Integer> toHide, boolean inSingleFileFragment) {
|
||||
boolean disableSharingViaMDM = ContextExtensionsKt.getRestriction(context, AppConfigKeys.DisableSharing, context.getResources().getBoolean(R.bool.disable_sharing));
|
||||
if (!disableSharingViaMDM || (overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps)) || containsEncryptedFile()) ||
|
||||
if (!MDMConfig.INSTANCE.sendFilesSupport(context) || (overflowMenu || containsEncryptedFile()) ||
|
||||
(!inSingleFileFragment && (isSingleSelection() || !allFileDown())) ||
|
||||
!toHide.contains(R.id.action_send_share_file)) {
|
||||
toHide.add(R.id.action_send_file);
|
||||
|
|
Loading…
Reference in a new issue