only make AccountManager throw an exception on blocking calls in the UI thread if the application's SDK is froyo or later
This commit is contained in:
@@ -27,6 +27,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.RemoteException;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -841,7 +842,9 @@ public class AccountManager {
|
||||
"calling this from your main thread can lead to deadlock");
|
||||
Log.e(TAG, "calling this from your main thread can lead to deadlock and/or ANRs",
|
||||
exception);
|
||||
throw exception;
|
||||
if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.FROYO) {
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1788,7 +1788,7 @@ public class AccountManagerService
|
||||
if (!permissionGranted && isDebuggableMonkeyBuild) {
|
||||
// TODO: Skip this check when running automated tests. Replace this
|
||||
// with a more general solution.
|
||||
Log.w(TAG, "no credentials permission for usage of " + account + ", "
|
||||
Log.d(TAG, "no credentials permission for usage of " + account + ", "
|
||||
+ authTokenType + " by uid " + Binder.getCallingUid()
|
||||
+ " but ignoring since this is a monkey build");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user