Skip to content

Commit f821221

Browse files
committed
deprecated constructor replaced.
1 parent 67c73e4 commit f821221

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if(rootProject.file('token.properties').exists()) {
7272
project.ext.set('accessToken', apikeys['accessToken'])
7373
} else {
7474
println "*** File `token.properties` is missing; the GitHub API may be rate-limited."
75-
println "*** The personal access token needs to be defined with EditTextPreference."
75+
println "*** The personal access token needs to be defined with an EditTextPreference."
7676
project.ext.set('accessToken', "")
7777
}
7878

mobile/src/main/java/io/syslogic/github/network/TokenHelper.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.content.pm.PackageManager;
1010
import android.os.Bundle;
1111
import android.os.Handler;
12+
import android.os.Looper;
1213
import android.util.Log;
1314

1415
import com.google.gson.JsonObject;
@@ -66,7 +67,7 @@ public static void setAccessToken(Activity activity, @Nullable String token) {
6667
if (account != null && token == null) {
6768
accountManager.removeAccount(account, activity, accountManagerFuture -> {
6869
Log.d(LOG_TAG, "Account removed: " + Constants.ACCOUNT_TYPE);
69-
}, new Handler());
70+
}, new Handler(Looper.getMainLooper()));
7071
} else if (account == null && token == null) {
7172
/* This maybe happen when the token loaded from package-meta has expired. */
7273
Intent intent = new Intent(activity, AuthenticatorActivity.class);
@@ -143,13 +144,13 @@ public void onResponse(@NonNull Call<User> call, @NonNull Response<User> respons
143144
}
144145
}
145146
} catch (IOException e) {
146-
if (BuildConfig.DEBUG) {Log.e(LOG_TAG, "" + e.getMessage());}
147+
if (BuildConfig.DEBUG) {Log.e(LOG_TAG, "IOException: " + e.getMessage());}
147148
}
148149
}
149150
}
150151
@Override
151152
public void onFailure(@NonNull Call<User> call, @NonNull Throwable t) {
152-
Log.e(LOG_TAG, "" + t.getMessage());
153+
Log.e(LOG_TAG, "onFailure: " + t.getMessage());
153154
}
154155
});
155156
}
@@ -172,7 +173,7 @@ private static Account getAccount(@NonNull AccountManager accountManager, int in
172173
@Nullable
173174
public static Account addAccount(AccountManager accountManager, String username, String token) {
174175
if (getAccount(accountManager, 0) == null) {
175-
Account account = new Account("" + username + "@github.com", Constants.ACCOUNT_TYPE);
176+
Account account = new Account(username + "@github.com", Constants.ACCOUNT_TYPE);
176177
Bundle extraData = new Bundle();
177178
extraData.putString("username", username);
178179
extraData.putString("token", token);

0 commit comments

Comments
 (0)