@@ -499,7 +499,7 @@ public void onResult(Bundle result) {
499499 if (response != null ) {
500500 try {
501501 if (result == null ) {
502- onError (AccountManager .ERROR_CODE_INVALID_RESPONSE , "null bundle" );
502+ response . onError (AccountManager .ERROR_CODE_INVALID_RESPONSE , "null bundle" );
503503 return ;
504504 }
505505 if (Log .isLoggable (TAG , Log .VERBOSE )) {
@@ -1541,8 +1541,15 @@ public void onServiceDisconnected(ComponentName name) {
15411541 mAuthenticator = null ;
15421542 IAccountManagerResponse response = getResponseAndClose ();
15431543 if (response != null ) {
1544- onError (AccountManager .ERROR_CODE_REMOTE_EXCEPTION ,
1545- "disconnected" );
1544+ try {
1545+ response .onError (AccountManager .ERROR_CODE_REMOTE_EXCEPTION ,
1546+ "disconnected" );
1547+ } catch (RemoteException e ) {
1548+ if (Log .isLoggable (TAG , Log .VERBOSE )) {
1549+ Log .v (TAG , "Session.onServiceDisconnected: "
1550+ + "caught RemoteException while responding" , e );
1551+ }
1552+ }
15461553 }
15471554 }
15481555
@@ -1551,8 +1558,15 @@ public void onServiceDisconnected(ComponentName name) {
15511558 public void onTimedOut () {
15521559 IAccountManagerResponse response = getResponseAndClose ();
15531560 if (response != null ) {
1554- onError (AccountManager .ERROR_CODE_REMOTE_EXCEPTION ,
1555- "timeout" );
1561+ try {
1562+ response .onError (AccountManager .ERROR_CODE_REMOTE_EXCEPTION ,
1563+ "timeout" );
1564+ } catch (RemoteException e ) {
1565+ if (Log .isLoggable (TAG , Log .VERBOSE )) {
1566+ Log .v (TAG , "Session.onTimedOut: caught RemoteException while responding" ,
1567+ e );
1568+ }
1569+ }
15561570 }
15571571 }
15581572
0 commit comments