Skip to content

Commit

Permalink
Code refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed May 25, 2023
1 parent 22ffe84 commit b65dbb0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,15 @@ default void onDarkThemeModeChanged(DarkMode mode) {
void setDataAnalysis(boolean enableDataAnalysis);
boolean isDataAnalysisEnabled();

/**
* Saves the privacy policy action taken by user
* this will maintain the state of current privacy policy action taken
* @see com.nmc.android.ui.LoginPrivacySettingsActivity for actions
* @param userAction taken by user
*/
void setPrivacyPolicyAction(int userAction);
int getPrivacyPolicyAction();

/**
* Gets status of migration to user id, default false
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.account.UserAccountManagerImpl;
import com.nmc.android.ui.LoginPrivacySettingsActivity;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
import com.owncloud.android.datamodel.FileDataStorageManager;
Expand Down Expand Up @@ -104,6 +105,7 @@ public final class AppPreferencesImpl implements AppPreferences {
private static final String PREF__IN_APP_REVIEW_DATA = "in_app_review_data";

private static final String PREF__DATA_ANALYSIS = "data_analysis";
private static final String PREF__PRIVACY_POLICY_ACTION = "privacy_policy_action";

private final Context context;
private final SharedPreferences preferences;
Expand Down Expand Up @@ -584,6 +586,16 @@ public boolean isDataAnalysisEnabled() {
return preferences.getBoolean(PREF__DATA_ANALYSIS, true);
}

@Override
public void setPrivacyPolicyAction(int userAction) {
preferences.edit().putInt(PREF__PRIVACY_POLICY_ACTION, userAction).apply();
}

@Override
public int getPrivacyPolicyAction() {
return preferences.getInt(PREF__PRIVACY_POLICY_ACTION, LoginPrivacySettingsActivity.NO_ACTION);
}

@Override
public boolean isUserIdMigrated() {
return preferences.getBoolean(PREF__MIGRATED_USER_ID, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import com.owncloud.android.BuildConfig
import com.owncloud.android.R

object MoEngageSdkUtils {

//enable/disable moengage as we are not using it right now due to no proper firebase api key
private const val MOENGAGE_ENABLED = false

@JvmStatic
fun initMoEngageSDK(application: Application) {
if (application.resources.getBoolean(R.bool.moengage_enabled)) {
if (MOENGAGE_ENABLED) {
val moEngage = MoEngage.Builder(application, BuildConfig.MOENGAGE_APP_ID)
.build()
MoEngage.initialise(moEngage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
import com.nextcloud.client.logger.ui.LogsActivity;
import com.nextcloud.client.network.ClientFactory;
import com.nextcloud.client.preferences.AppPreferences;
import com.nmc.android.marketTracking.TealiumSdkUtils;
import com.nextcloud.client.preferences.AppPreferencesImpl;
import com.nextcloud.client.preferences.DarkMode;
import com.nmc.android.marketTracking.TealiumSdkUtils;
import com.owncloud.android.BuildConfig;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
import com.nextcloud.ui.fileactions.FileActionsBottomSheet;
import com.nextcloud.utils.EditorUtils;
import com.nextcloud.utils.ShortcutUtil;
import com.nmc.android.marketTracking.TrackingScanInterface;
import com.nextcloud.utils.view.FastScrollUtils;
import com.nmc.android.marketTracking.AdjustSdkUtils;
import com.nmc.android.marketTracking.TrackingScanInterface;
import com.nmc.android.marketTracking.TrackingScanInterfaceImpl;
import com.nmc.android.marketTracking.TealiumSdkUtils;
import com.owncloud.android.MainApp;
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@
<string name="dev_changelog">https://github.com/nextcloud/android/raw/dev/CHANGELOG.md</string>

<string name="buildNumber" translatable="false"></string>

<!-- NMC Note: will be used to enable/disable moengage as we are not using it right now due to no proper api key -->
<bool name="moengage_enabled">false</bool>
</resources>


0 comments on commit b65dbb0

Please sign in to comment.