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:
Fred Quintana
2010-02-09 14:13:18 -08:00
parent 6420877c8a
commit 751fdc09bb
2 changed files with 5 additions and 2 deletions

View File

@@ -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;
}
}
}

View File

@@ -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;