better variable naming

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-11-05 11:13:24 +01:00 committed by Alper Öztürk
parent 66902d2ced
commit 8bdfbb49ab
5 changed files with 18 additions and 18 deletions

View file

@ -339,8 +339,8 @@ public class MainApp extends Application implements HasAndroidInjector, NetworkC
// initialise thumbnails cache on background thread
new ThumbnailsCacheManager.InitDiskCacheTask().execute();
boolean disableLog = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log));
if ((BuildConfig.DEBUG || getApplicationContext().getResources().getBoolean(R.bool.logger_enabled)) && !disableLog) {
boolean disableLogViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log));
if ((BuildConfig.DEBUG || getApplicationContext().getResources().getBoolean(R.bool.logger_enabled)) && !disableLogViaMDM) {
// use app writable dir, no permissions needed
Log_OC.setLoggerImplementation(new LegacyLoggerAdapter(logger));
Log_OC.d("Debug", "start logging");

View file

@ -186,8 +186,8 @@ public class FileMenuFilter {
}
private void filterSendFiles(List<Integer> toHide, boolean inSingleFileFragment) {
boolean disableSharing = ContextExtensionsKt.getRestriction(context, AppConfigKeys.DisableSharing, context.getResources().getBoolean(R.bool.disable_sharing));
if (!disableSharing || (overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps)) || containsEncryptedFile()) ||
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()) ||
(!inSingleFileFragment && (isSingleSelection() || !allFileDown())) ||
!toHide.contains(R.id.action_send_share_file)) {
toHide.add(R.id.action_send_file);

View file

@ -604,11 +604,11 @@ public abstract class DrawerActivity extends ToolbarActivity
}
public void openAddAccount() {
boolean disableIntro = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableIntro, getResources().getBoolean(R.bool.disable_intro));
boolean disableIntroViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableIntro, getResources().getBoolean(R.bool.disable_intro));
boolean isProviderOrOwnInstallationVisible = getResources()
.getBoolean(R.bool.show_provider_or_own_installation);
if (isProviderOrOwnInstallationVisible && !disableIntro) {
if (isProviderOrOwnInstallationVisible && !disableIntroViaMDM) {
Intent firstRunIntent = new Intent(getApplicationContext(), FirstRunActivity.class);
firstRunIntent.putExtra(FirstRunActivity.EXTRA_ALLOW_CLOSE, true);
startActivity(firstRunIntent);
@ -827,8 +827,8 @@ public abstract class DrawerActivity extends ToolbarActivity
private void updateQuotaLink() {
if (mQuotaTextLink != null) {
boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSite) {
boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSiteViaMDM) {
List<ExternalLink> quotas = externalLinksProvider.getExternalLink(ExternalLinkType.QUOTA);
float density = getResources().getDisplayMetrics().density;
@ -977,8 +977,8 @@ public abstract class DrawerActivity extends ToolbarActivity
}
private void updateExternalLinksInDrawer() {
boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (mNavigationView != null && getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSite) {
boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (mNavigationView != null && getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSiteViaMDM) {
mNavigationView.getMenu().removeGroup(R.id.drawer_menu_external_links);
int greyColor = ContextCompat.getColor(this, R.color.drawer_menu_icon);
@ -1227,8 +1227,8 @@ public abstract class DrawerActivity extends ToolbarActivity
* Retrieves external links via api from 'external' app
*/
public void fetchExternalLinks(final boolean force) {
boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (!getBaseContext().getResources().getBoolean(R.bool.show_external_links) || disableMoreExternalSite) {
boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (!getBaseContext().getResources().getBoolean(R.bool.show_external_links) || disableMoreExternalSiteViaMDM) {
return;
}

View file

@ -381,11 +381,11 @@ public class SettingsActivity extends PreferenceActivity
}
private void setupLoggingPreference(PreferenceCategory preferenceCategoryMore) {
boolean disableLog = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log));
boolean disableLogViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log));
boolean loggerEnabled = getResources().getBoolean(R.bool.logger_enabled) || BuildConfig.DEBUG;
Preference pLogger = findPreference("logger");
if (pLogger != null) {
if (loggerEnabled && !disableLog) {
if (loggerEnabled && !disableLogViaMDM) {
pLogger.setOnPreferenceClickListener(preference -> {
Intent loggerIntent = new Intent(getApplicationContext(), LogsActivity.class);
startActivity(loggerIntent);
@ -1103,8 +1103,8 @@ public class SettingsActivity extends PreferenceActivity
}
private void loadExternalSettingLinks(PreferenceCategory preferenceCategory) {
boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSite) {
boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site));
if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSiteViaMDM) {
ExternalLinksProvider externalLinksProvider = new ExternalLinksProvider(getContentResolver());
for (final ExternalLink link : externalLinksProvider.getExternalLink(ExternalLinkType.SETTINGS)) {

View file

@ -320,11 +320,11 @@ public class UserListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
* @param accountListAdapterListener {@link Listener}
*/
private void bind(Listener accountListAdapterListener) {
boolean disableIntro = ContextExtensionsKt.getRestriction(context, AppConfigKeys.DisableIntro, context.getResources().getBoolean(R.bool.disable_intro));
boolean disableIntroViaMDM = ContextExtensionsKt.getRestriction(context, AppConfigKeys.DisableIntro, context.getResources().getBoolean(R.bool.disable_intro));
boolean isProviderOrOwnInstallationVisible = itemView.getContext().getResources()
.getBoolean(R.bool.show_provider_or_own_installation);
if (isProviderOrOwnInstallationVisible && !disableIntro) {
if (isProviderOrOwnInstallationVisible && !disableIntroViaMDM) {
itemView.setOnClickListener(v -> accountListAdapterListener.showFirstRunActivity());
} else {
itemView.setOnClickListener(v -> accountListAdapterListener.startAccountCreation());