Loading cmds/dumpstate/dumpstate.c +2 −3 Original line number Diff line number Diff line Loading @@ -86,9 +86,9 @@ static void dumpstate(int full) { DUMP("/proc/wakelocks"); PRINT(""); PRINT("------ PROCESSES ------"); EXEC("ps"); EXEC1("ps", "-P"); PRINT("------ PROCESSES AND THREADS ------"); EXEC2("ps", "-t", "-p"); EXEC3("ps", "-t", "-p", "-P"); PRINT("------ LIBRANK ------"); EXEC_XBIN("librank"); PRINT("------ BINDER FAILED TRANSACTION LOG ------"); Loading Loading @@ -362,4 +362,3 @@ static void dump_kernel_log(const char *path, const char *title) DUMP(path); } } cmds/dumpstate/dumpstate.h +18 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ run_command(&c, TIMEOUT); \ } #define EXEC1(cmd, a1) \ { \ static struct Command c = { \ "/system/bin/" cmd, \ { cmd, a1, 0 } \ }; \ run_command(&c, TIMEOUT); \ } #define EXEC2(cmd, a1, a2) \ { \ static struct Command c = { \ Loading @@ -70,6 +79,15 @@ run_command(&c, TIMEOUT); \ } #define EXEC3(cmd, a1, a2, a3) \ { \ static struct Command c = { \ "/system/bin/" cmd, \ { cmd, a1, a2, a3, 0 } \ }; \ run_command(&c, TIMEOUT); \ } #define EXEC4(cmd, a1, a2, a3, a4) \ { \ static struct Command c = { \ Loading core/java/android/accounts/AbstractAccountAuthenticator.java +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ import android.Manifest; * The activity must then call {@link AccountAuthenticatorResponse#onResult} or * {@link AccountAuthenticatorResponse#onError} when it is complete. * <li> If the authenticator cannot synchronously process the request and return a result then it * may choose to return null and then use the {@link AccountManagerResponse} to send the result * may choose to return null and then use the AccountManagerResponse to send the result * when it has completed the request. * </ul> * <p> Loading core/java/android/accounts/AccountManager.java +26 −12 Original line number Diff line number Diff line Loading @@ -321,7 +321,8 @@ public class AccountManager { */ public String peekAuthToken(final Account account, final String authTokenType) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "peekAuthToken: the account must not be null"); return null; } if (authTokenType == null) { return null; Loading @@ -346,7 +347,8 @@ public class AccountManager { */ public void setPassword(final Account account, final String password) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "the account must not be null"); return; } try { mService.setPassword(account, password); Loading @@ -365,7 +367,8 @@ public class AccountManager { */ public void clearPassword(final Account account) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "the account must not be null"); return; } try { mService.clearPassword(account); Loading @@ -388,10 +391,12 @@ public class AccountManager { */ public void setUserData(final Account account, final String key, final String value) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "the account must not be null"); return; } if (key == null) { throw new IllegalArgumentException("the key must not be null"); Log.e(TAG, "the key must not be null"); return; } try { mService.setUserData(account, key, value); Loading Loading @@ -602,11 +607,14 @@ public class AccountManager { final String authTokenType, final String[] requiredFeatures, final Bundle addAccountOptions, final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) { if (accountType == null) { throw new IllegalArgumentException(); } return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { if (accountType == null) { Log.e(TAG, "the account must not be null"); // to unblock caller waiting on Future.get() set(new Bundle()); return; } mService.addAcount(mResponse, accountType, authTokenType, requiredFeatures, activity != null, addAccountOptions); } Loading @@ -616,9 +624,13 @@ public class AccountManager { public AccountManagerFuture<Account[]> getAccountsByTypeAndFeatures( final String type, final String[] features, AccountManagerCallback<Account[]> callback, Handler handler) { if (type == null) throw new IllegalArgumentException("type is null"); return new Future2Task<Account[]>(handler, callback) { public void doWork() throws RemoteException { if (type == null) { Log.e(TAG, "Type is null"); set(new Account[0]); return; } mService.getAccountsByFeatures(mResponse, type, features); } public Account[] bundleToResult(Bundle bundle) throws AuthenticatorException { Loading Loading @@ -785,7 +797,7 @@ public class AccountManager { //noinspection ThrowableInstanceNeverThrow // Log.e(TAG, "calling this from your main thread can lead to deadlock and/or ANRs", // new Exception()); // TODO(fredq) remove the log and throw this exception when the callers are fixed // TODO remove the log and throw this exception when the callers are fixed // throw new IllegalStateException( // "calling this from your main thread can lead to deadlock"); } Loading Loading @@ -1338,11 +1350,13 @@ public class AccountManager { */ public void removeOnAccountsUpdatedListener(OnAccountsUpdateListener listener) { if (listener == null) { throw new IllegalArgumentException("the listener is null"); Log.e(TAG, "Missing listener"); return; } synchronized (mAccountsUpdatedListeners) { if (!mAccountsUpdatedListeners.containsKey(listener)) { throw new IllegalStateException("this listener was not previously added"); Log.e(TAG, "Listener was not previously added"); return; } mAccountsUpdatedListeners.remove(listener); if (mAccountsUpdatedListeners.isEmpty()) { Loading core/java/android/accounts/AccountManagerService.java +0 −64 Original line number Diff line number Diff line Loading @@ -429,14 +429,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { if (account == null) { try { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "null account"); } catch (RemoteException e) { // it doesn't matter if we are unable to deliver this error } return; } new RemoveAccountSession(response, account).bind(); } finally { restoreCallingIdentity(identityToken); Loading Loading @@ -706,22 +698,6 @@ public class AccountManagerService long identityToken = clearCallingIdentity(); try { try { if (account == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "account is null"); return; } if (authTokenType == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "authTokenType is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } // if the caller has permission, do the peek. otherwise go the more expensive // route of starting a Session if (permissionGranted) { Loading Loading @@ -887,16 +863,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (authTokenType == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "authTokenType is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, accountType, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.addAccount(this, mAccountType, authTokenType, requiredFeatures, Loading @@ -922,16 +888,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (account == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "account is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, account.type, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.confirmCredentials(this, account, options); Loading @@ -952,16 +908,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (account == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "account is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, account.type, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.updateCredentials(this, account, authTokenType, loginOptions); Loading @@ -984,16 +930,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (accountType == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "accountType is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, accountType, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.editProperties(this, mAccountType); Loading Loading
cmds/dumpstate/dumpstate.c +2 −3 Original line number Diff line number Diff line Loading @@ -86,9 +86,9 @@ static void dumpstate(int full) { DUMP("/proc/wakelocks"); PRINT(""); PRINT("------ PROCESSES ------"); EXEC("ps"); EXEC1("ps", "-P"); PRINT("------ PROCESSES AND THREADS ------"); EXEC2("ps", "-t", "-p"); EXEC3("ps", "-t", "-p", "-P"); PRINT("------ LIBRANK ------"); EXEC_XBIN("librank"); PRINT("------ BINDER FAILED TRANSACTION LOG ------"); Loading Loading @@ -362,4 +362,3 @@ static void dump_kernel_log(const char *path, const char *title) DUMP(path); } }
cmds/dumpstate/dumpstate.h +18 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ run_command(&c, TIMEOUT); \ } #define EXEC1(cmd, a1) \ { \ static struct Command c = { \ "/system/bin/" cmd, \ { cmd, a1, 0 } \ }; \ run_command(&c, TIMEOUT); \ } #define EXEC2(cmd, a1, a2) \ { \ static struct Command c = { \ Loading @@ -70,6 +79,15 @@ run_command(&c, TIMEOUT); \ } #define EXEC3(cmd, a1, a2, a3) \ { \ static struct Command c = { \ "/system/bin/" cmd, \ { cmd, a1, a2, a3, 0 } \ }; \ run_command(&c, TIMEOUT); \ } #define EXEC4(cmd, a1, a2, a3, a4) \ { \ static struct Command c = { \ Loading
core/java/android/accounts/AbstractAccountAuthenticator.java +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ import android.Manifest; * The activity must then call {@link AccountAuthenticatorResponse#onResult} or * {@link AccountAuthenticatorResponse#onError} when it is complete. * <li> If the authenticator cannot synchronously process the request and return a result then it * may choose to return null and then use the {@link AccountManagerResponse} to send the result * may choose to return null and then use the AccountManagerResponse to send the result * when it has completed the request. * </ul> * <p> Loading
core/java/android/accounts/AccountManager.java +26 −12 Original line number Diff line number Diff line Loading @@ -321,7 +321,8 @@ public class AccountManager { */ public String peekAuthToken(final Account account, final String authTokenType) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "peekAuthToken: the account must not be null"); return null; } if (authTokenType == null) { return null; Loading @@ -346,7 +347,8 @@ public class AccountManager { */ public void setPassword(final Account account, final String password) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "the account must not be null"); return; } try { mService.setPassword(account, password); Loading @@ -365,7 +367,8 @@ public class AccountManager { */ public void clearPassword(final Account account) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "the account must not be null"); return; } try { mService.clearPassword(account); Loading @@ -388,10 +391,12 @@ public class AccountManager { */ public void setUserData(final Account account, final String key, final String value) { if (account == null) { throw new IllegalArgumentException("the account must not be null"); Log.e(TAG, "the account must not be null"); return; } if (key == null) { throw new IllegalArgumentException("the key must not be null"); Log.e(TAG, "the key must not be null"); return; } try { mService.setUserData(account, key, value); Loading Loading @@ -602,11 +607,14 @@ public class AccountManager { final String authTokenType, final String[] requiredFeatures, final Bundle addAccountOptions, final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) { if (accountType == null) { throw new IllegalArgumentException(); } return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { if (accountType == null) { Log.e(TAG, "the account must not be null"); // to unblock caller waiting on Future.get() set(new Bundle()); return; } mService.addAcount(mResponse, accountType, authTokenType, requiredFeatures, activity != null, addAccountOptions); } Loading @@ -616,9 +624,13 @@ public class AccountManager { public AccountManagerFuture<Account[]> getAccountsByTypeAndFeatures( final String type, final String[] features, AccountManagerCallback<Account[]> callback, Handler handler) { if (type == null) throw new IllegalArgumentException("type is null"); return new Future2Task<Account[]>(handler, callback) { public void doWork() throws RemoteException { if (type == null) { Log.e(TAG, "Type is null"); set(new Account[0]); return; } mService.getAccountsByFeatures(mResponse, type, features); } public Account[] bundleToResult(Bundle bundle) throws AuthenticatorException { Loading Loading @@ -785,7 +797,7 @@ public class AccountManager { //noinspection ThrowableInstanceNeverThrow // Log.e(TAG, "calling this from your main thread can lead to deadlock and/or ANRs", // new Exception()); // TODO(fredq) remove the log and throw this exception when the callers are fixed // TODO remove the log and throw this exception when the callers are fixed // throw new IllegalStateException( // "calling this from your main thread can lead to deadlock"); } Loading Loading @@ -1338,11 +1350,13 @@ public class AccountManager { */ public void removeOnAccountsUpdatedListener(OnAccountsUpdateListener listener) { if (listener == null) { throw new IllegalArgumentException("the listener is null"); Log.e(TAG, "Missing listener"); return; } synchronized (mAccountsUpdatedListeners) { if (!mAccountsUpdatedListeners.containsKey(listener)) { throw new IllegalStateException("this listener was not previously added"); Log.e(TAG, "Listener was not previously added"); return; } mAccountsUpdatedListeners.remove(listener); if (mAccountsUpdatedListeners.isEmpty()) { Loading
core/java/android/accounts/AccountManagerService.java +0 −64 Original line number Diff line number Diff line Loading @@ -429,14 +429,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { if (account == null) { try { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "null account"); } catch (RemoteException e) { // it doesn't matter if we are unable to deliver this error } return; } new RemoveAccountSession(response, account).bind(); } finally { restoreCallingIdentity(identityToken); Loading Loading @@ -706,22 +698,6 @@ public class AccountManagerService long identityToken = clearCallingIdentity(); try { try { if (account == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "account is null"); return; } if (authTokenType == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "authTokenType is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } // if the caller has permission, do the peek. otherwise go the more expensive // route of starting a Session if (permissionGranted) { Loading Loading @@ -887,16 +863,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (authTokenType == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "authTokenType is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, accountType, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.addAccount(this, mAccountType, authTokenType, requiredFeatures, Loading @@ -922,16 +888,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (account == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "account is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, account.type, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.confirmCredentials(this, account, options); Loading @@ -952,16 +908,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (account == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "account is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, account.type, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.updateCredentials(this, account, authTokenType, loginOptions); Loading @@ -984,16 +930,6 @@ public class AccountManagerService checkManageAccountsPermission(); long identityToken = clearCallingIdentity(); try { try { if (accountType == null) { response.onError(AccountManager.ERROR_CODE_BAD_ARGUMENTS, "accountType is null"); return; } } catch (RemoteException e) { // it doesn't matter if we can't deliver this error return; } new Session(response, accountType, expectActivityLaunch) { public void run() throws RemoteException { mAuthenticator.editProperties(this, mAccountType); Loading