Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77eaba5e authored by Stefan Niedermann's avatar Stefan Niedermann
Browse files

docs(helper): Renamed internal LiveData class and clarifies @Deprecations

parent 592195bb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public final class SingleAccountHelper {
    }

    public static LiveData<SingleSignOnAccount> getCurrentSingleSignOnAccount$(@NonNull Context context) {
        return new CurrentSingleSignOnAccountLiveData(context, AccountImporter.getSharedPreferences(context), PREF_CURRENT_ACCOUNT_STRING);
        return new SingleSignOnAccountLiveData(context, AccountImporter.getSharedPreferences(context), PREF_CURRENT_ACCOUNT_STRING);
    }

    /**
@@ -90,7 +90,7 @@ public final class SingleAccountHelper {
    /**
     * @deprecated Use {@link #getCurrentSingleSignOnAccount$(Context)} which is lifecycle aware
     */
    @Deprecated
    @Deprecated(forRemoval = true)
    public static void registerSharedPreferenceChangeListener(Context context, 
                                                                SharedPreferences.OnSharedPreferenceChangeListener listener) {
        AccountImporter.getSharedPreferences(context)
@@ -100,7 +100,7 @@ public final class SingleAccountHelper {
    /**
     * @deprecated Use {@link #getCurrentSingleSignOnAccount$(Context)} which is lifecycle aware
     */
    @Deprecated
    @Deprecated(forRemoval = true)
    public static void unregisterSharedPreferenceChangeListener(Context context,
                                                                SharedPreferences.OnSharedPreferenceChangeListener listener) {
        AccountImporter.getSharedPreferences(context)
+2 −2
Original line number Diff line number Diff line
@@ -31,13 +31,13 @@ import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundExce
import com.nextcloud.android.sso.exceptions.NoCurrentAccountSelectedException;
import com.nextcloud.android.sso.model.SingleSignOnAccount;

public class CurrentSingleSignOnAccountLiveData extends LiveData<SingleSignOnAccount> {
public class SingleSignOnAccountLiveData extends LiveData<SingleSignOnAccount> {

    private final Context context;
    private final SharedPreferences sharedPrefs;
    private final SharedPreferences.OnSharedPreferenceChangeListener preferenceChangeListener;

    CurrentSingleSignOnAccountLiveData(@NonNull Context context, @NonNull SharedPreferences sharedPrefs, @NonNull String key) {
    SingleSignOnAccountLiveData(@NonNull Context context, @NonNull SharedPreferences sharedPrefs, @NonNull String key) {
        this.context = context;
        this.sharedPrefs = sharedPrefs;
        this.preferenceChangeListener = (changedPrefs, changedKey) -> {