Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ public void close() {
mContext = null;
}

/**
* @deprecated Use {@link #close()}
*/
@Deprecated(forRemoval = true)
public void stop() {
close();
}

private void unbindService() {
// Unbind from the service
if (mBound.get()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ public void close() {
mDestroyed = true;
}

/**
* @deprecated Use {@link #close()}
*/
@Deprecated(forRemoval = true)
protected void stop() {
close();
}

protected String getAccountName() {
return mAccount.name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ public void close() {
networkRequest.close();
}

/**
* @deprecated Use {@link #close()}
*/
@Deprecated(forRemoval = true)
public void stop() {
close();
}

public <T> Observable<ParsedResponse<T>> performRequestObservableV2(final Type type, final NextcloudRequest request) {
ensureTypeNotVoid(type);
return Observable.fromPublisher(s -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@

public class AccountImportCancelledException extends SSOException {

/**
* @deprecated Use {@link #AccountImportCancelledException(Context)}
*/
@Deprecated(forRemoval = true)
public AccountImportCancelledException() {
this(getContext());
}

public AccountImportCancelledException(@NonNull Context context) {
super(
context.getString(R.string.sso_canceled_message),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@

public class AndroidGetAccountsPermissionNotGranted extends SSOException {

/**
* @deprecated Use {@link #AndroidGetAccountsPermissionNotGranted(Context)}
*/
@Deprecated(forRemoval = true)
public AndroidGetAccountsPermissionNotGranted() {
this(getContext());
}

public AndroidGetAccountsPermissionNotGranted(@NonNull Context context) {
super(
context.getString(R.string.android_get_accounts_permission_not_granted_exception_message),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@

public class NextcloudApiNotRespondingException extends SSOException {

/**
* @deprecated Use {@link #NextcloudApiNotRespondingException(Context)}
*/
@Deprecated(forRemoval = true)
public NextcloudApiNotRespondingException() {
this(getContext());
}

public NextcloudApiNotRespondingException(@NonNull Context context) {
super(
context.getString(R.string.nextcloud_files_api_not_responding_message),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@

public class NextcloudFilesAppAccountNotFoundException extends SSOException {

/**
* @deprecated Use {@link #NextcloudFilesAppAccountNotFoundException(Context)}
*/
@Deprecated(forRemoval = true)
public NextcloudFilesAppAccountNotFoundException() {
this(getContext());
}

public NextcloudFilesAppAccountNotFoundException(@NonNull Context context) {
this(context, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@

public class NextcloudFilesAppAccountPermissionNotGrantedException extends SSOException {

/**
* @deprecated Use {@link #NextcloudFilesAppAccountPermissionNotGrantedException(Context)}
*/
@Deprecated(forRemoval = true)
public NextcloudFilesAppAccountPermissionNotGrantedException() {
this(getContext());
}

public NextcloudFilesAppAccountPermissionNotGrantedException(@NonNull Context context) {
super(
context.getString(R.string.nextcloud_files_app_account_permission_not_granted_message),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@

public class NextcloudFilesAppNotInstalledException extends SSOException {

/**
* @deprecated Use {@link #NextcloudFilesAppNotInstalledException(Context)}
*/
@Deprecated(forRemoval = true)
public NextcloudFilesAppNotInstalledException() {
this(getContext());
}


public NextcloudFilesAppNotInstalledException(@NonNull Context context) {
this(context, new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.url_files_app_marketplace))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@

public class NextcloudFilesAppNotSupportedException extends SSOException {

/**
* @deprecated Use {@link #NextcloudFilesAppNotSupportedException(Context)}
*/
@Deprecated(forRemoval = true)
public NextcloudFilesAppNotSupportedException() {
this(getContext());
}

public NextcloudFilesAppNotSupportedException(@NonNull Context context) {
super(
context.getString(R.string.nextcloud_files_app_not_supported_message),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ public class NextcloudHttpRequestFailedException extends SSOException {

private final int statusCode;

/**
* @deprecated Use {@link #NextcloudHttpRequestFailedException(Context, int, Throwable)}
*/
@Deprecated(forRemoval = true)
public NextcloudHttpRequestFailedException(int statusCode, Throwable cause) {
this(getContext(), statusCode, cause);
}

public NextcloudHttpRequestFailedException(@NonNull Context context, int statusCode, @Nullable Throwable cause) {
super(
context.getString(R.string.nextcloud_http_request_failed_message, statusCode),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@

public class NextcloudInvalidRequestUrlException extends SSOException {

/**
* @deprecated Use {@link #NextcloudInvalidRequestUrlException(Context, Throwable)}
*/
@Deprecated(forRemoval = true)
public NextcloudInvalidRequestUrlException(String text) {
this(getContext(), new Throwable(text));
}

public NextcloudInvalidRequestUrlException(@NonNull Context context, @Nullable Throwable cause) {
super(
context.getString(R.string.nextcloud_invalid_request_url_message, cause == null ? context.getString(R.string.unknown_error_title) : cause.getMessage()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@

public class NextcloudUnsupportedMethodException extends SSOException {

/**
* @deprecated Use {@link #NextcloudUnsupportedMethodException(Context)}
*/
@Deprecated(forRemoval = true)
public NextcloudUnsupportedMethodException() {
this(getContext());
}

public NextcloudUnsupportedMethodException(@NonNull Context context) {
super(
context.getString(R.string.nextcloud_unsupported_method_message),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@

public class NoCurrentAccountSelectedException extends SSOException {

/**
* @deprecated Use {@link #NoCurrentAccountSelectedException(Context)}
*/
@Deprecated(forRemoval = true)
public NoCurrentAccountSelectedException() {
this(getContext());
}

public NoCurrentAccountSelectedException(@NonNull Context context) {
super(
context.getString(R.string.no_current_account_selected_exception_message),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.nextcloud.android.sso.exceptions;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;

Expand All @@ -29,7 +28,6 @@

import com.nextcloud.android.sso.Constants;

import java.lang.reflect.InvocationTargetException;
import java.util.Optional;

public class SSOException extends Exception {
Expand Down Expand Up @@ -79,30 +77,6 @@ public SSOException(String message,
this.actionIntent = actionIntent;
}

/**
* @deprecated No need to call this method anymore. Message is already loaded in constructor.
*/
@Deprecated(forRemoval = true)
public void loadExceptionMessage(@NonNull Context context) {
// Nothing to do anymore
}

/**
* @deprecated Use {@link #getTitleRes()}
*/
@Deprecated(forRemoval = true)
public String getTitle(@NonNull Context context) {
return getTitleRes().map(context::getString).orElse("");
}

/**
* @deprecated Use {@link #getMessage()}
*/
@Deprecated(forRemoval = true)
public String getMessage(@SuppressWarnings("unused") @NonNull Context context) {
return getMessage();
}

public Optional<Integer> getTitleRes() {
return Optional.ofNullable(titleRes);
}
Expand All @@ -115,27 +89,6 @@ public Optional<Intent> getPrimaryAction() {
return Optional.ofNullable(actionIntent);
}

@Deprecated(forRemoval = true)
protected static Context getContext() {
try {
@SuppressLint("PrivateApi") final var context = (Context) Class.forName("android.app.ActivityThread")
.getMethod("currentApplication")
.invoke(null, (Object[]) null);
return context;
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |
IllegalAccessException e) {
throw new RuntimeException(e);
}
}

/**
* @deprecated Use {@link #parseNextcloudCustomException(Context, Exception)}
*/
@Deprecated(forRemoval = true)
public static SSOException parseNextcloudCustomException(@Nullable Exception exception) {
return parseNextcloudCustomException(getContext(), exception);
}

public static SSOException parseNextcloudCustomException(@NonNull Context context, @Nullable Exception exception) {
if (exception == null) {
return new UnknownErrorException("Parsed exception is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@

public class TokenMismatchException extends SSOException {

/**
* @deprecated Use {@link #TokenMismatchException(Context)}
*/
@Deprecated(forRemoval = true)
public TokenMismatchException() {
this(getContext());
}

public TokenMismatchException(@NonNull Context context) {
super(context.getString(R.string.token_mismatch_message), R.string.token_mismatch_title);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@

public class UnknownErrorException extends SSOException {

/**
* @deprecated Use {@link #UnknownErrorException(String)}
*/
@Deprecated(forRemoval = true)
public UnknownErrorException() {
super();
}

public UnknownErrorException(String message) {
super(message, R.string.unknown_error_title);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ public void close() {
mHandlerAdapter.removeCallbacks(mRunnable);
}

/**
* @deprecated Use {@link #close()}.
*/
@Deprecated(forRemoval = true)
public void stop() {
close();
}

/** Should call when the retry action has failed and we want to retry after a longer delay. */
private void notifyFailed(Exception ex) {
Log.d(TAG, "[notifyFailed] Error: [" + ex.getMessage() + "]");
Expand Down
Loading