Loading core/java/android/app/contentsuggestions/ContentSuggestionsManager.java +8 −7 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public final class ContentSuggestionsManager { try { mService.provideContextBitmap(mUser, bitmap, imageContextRequestExtras); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -117,7 +117,7 @@ public final class ContentSuggestionsManager { try { mService.provideContextImage(mUser, taskId, imageContextRequestExtras); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading Loading @@ -146,7 +146,7 @@ public final class ContentSuggestionsManager { mService.suggestContentSelections( mUser, request, new SelectionsCallbackWrapper(callback, callbackExecutor)); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -173,7 +173,7 @@ public final class ContentSuggestionsManager { mService.classifyContentSelections( mUser, request, new ClassificationsCallbackWrapper(callback, callbackExecutor)); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -193,7 +193,7 @@ public final class ContentSuggestionsManager { try { mService.notifyInteraction(mUser, requestId, interaction); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -213,9 +213,10 @@ public final class ContentSuggestionsManager { mService.isEnabled(mUser, receiver); return receiver.getIntResult() != 0; } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get the enable status."); } return false; } /** Loading core/java/android/view/autofill/AutofillManager.java +35 −16 Original line number Diff line number Diff line Loading @@ -751,6 +751,8 @@ public final class AutofillManager { } } catch (RemoteException e) { Log.e(TAG, "Could not figure out if there was an autofill session", e); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get session restore status: " + e); } } } Loading Loading @@ -864,7 +866,9 @@ public final class AutofillManager { mService.getFillEventHistory(receiver); return receiver.getParcelableResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get fill event history: " + e); return null; } } Loading Loading @@ -1477,10 +1481,13 @@ public final class AutofillManager { final SyncResultReceiver receiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS); try { mService.isServiceEnabled(mContext.getUserId(), mContext.getPackageName(), receiver); mService.isServiceEnabled(mContext.getUserId(), mContext.getPackageName(), receiver); return receiver.getIntResult() == 1; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get enabled autofill services status."); } } Loading @@ -1498,6 +1505,8 @@ public final class AutofillManager { return receiver.getParcelableResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get autofill services component name."); } } Loading @@ -1522,8 +1531,9 @@ public final class AutofillManager { mService.getUserDataId(receiver); return receiver.getStringResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get user data id for field classification."); } } Loading @@ -1544,8 +1554,9 @@ public final class AutofillManager { mService.getUserData(receiver); return receiver.getParcelableResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get user data for field classification."); } } Loading @@ -1561,7 +1572,7 @@ public final class AutofillManager { try { mService.setUserData(userData); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -1583,8 +1594,9 @@ public final class AutofillManager { mService.isFieldClassificationEnabled(receiver); return receiver.getIntResult() == 1; } catch (RemoteException e) { e.rethrowFromSystemServer(); return false; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get field classification enabled status."); } } Loading @@ -1606,8 +1618,9 @@ public final class AutofillManager { mService.getDefaultFieldClassificationAlgorithm(receiver); return receiver.getStringResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get default field classification algorithm."); } } Loading @@ -1627,8 +1640,9 @@ public final class AutofillManager { final String[] algorithms = receiver.getStringArrayResult(); return algorithms != null ? Arrays.asList(algorithms) : Collections.emptyList(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get available field classification algorithms."); } } Loading @@ -1651,6 +1665,8 @@ public final class AutofillManager { return receiver.getIntResult() == 1; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get autofill supported status."); } } Loading Loading @@ -2040,13 +2056,16 @@ public final class AutofillManager { } final SyncResultReceiver resultReceiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS); final int resultCode; int resultCode; try { mService.setAugmentedAutofillWhitelist(toList(packages), toList(activities), resultReceiver); resultCode = resultReceiver.getIntResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get the result of set AugmentedAutofill whitelist. " + e); return; } switch (resultCode) { case RESULT_OK: Loading Loading @@ -2283,7 +2302,7 @@ public final class AutofillManager { // In theory, we could ignore this error since it's not a big deal, but // in reality, we rather crash the app anyways, as the failure could be // a consequence of something going wrong on the server side... e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading Loading @@ -2661,7 +2680,7 @@ public final class AutofillManager { try { mService.onPendingSaveUi(operation, token); } catch (RemoteException e) { e.rethrowFromSystemServer(); Log.e(TAG, "Error in onPendingSaveUi: ", e); } } } Loading core/java/android/view/contentcapture/ContentCaptureManager.java +32 −15 Original line number Diff line number Diff line Loading @@ -487,6 +487,8 @@ public final class ContentCaptureManager { return resultReceiver.getParcelableResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get service componentName."); } } Loading Loading @@ -516,6 +518,9 @@ public final class ContentCaptureManager { return resultReceiver.getParcelableResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get service settings componentName: " + e); return null; } } Loading Loading @@ -567,9 +572,13 @@ public final class ContentCaptureManager { final SyncResultReceiver resultReceiver = syncRun( (r) -> mService.getContentCaptureConditions(mContext.getPackageName(), r)); try { final ArrayList<ContentCaptureCondition> result = resultReceiver .getParcelableListResult(); return toSet(result); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get content capture conditions."); } } /** Loading Loading @@ -639,6 +648,8 @@ public final class ContentCaptureManager { public boolean isContentCaptureFeatureEnabled() { final SyncResultReceiver resultReceiver = syncRun( (r) -> mService.isContentCaptureFeatureEnabled(r)); try { final int resultCode = resultReceiver.getIntResult(); switch (resultCode) { case RESULT_CODE_TRUE: Loading @@ -649,6 +660,10 @@ public final class ContentCaptureManager { Log.wtf(TAG, "received invalid result: " + resultCode); return false; } } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get content capture feature enable status: " + e); return false; } } /** Loading @@ -663,7 +678,7 @@ public final class ContentCaptureManager { try { mService.removeData(request); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading Loading @@ -691,7 +706,7 @@ public final class ContentCaptureManager { new DataShareAdapterDelegate(executor, dataShareWriteAdapter, mDataShareAdapterResourceManager)); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -709,10 +724,12 @@ public final class ContentCaptureManager { if (resultCode == RESULT_CODE_SECURITY_EXCEPTION) { throw new SecurityException(resultReceiver.getStringResult()); } return resultReceiver; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get syn run result from SyncResultReceiver."); } return resultReceiver; } /** @hide */ Loading core/java/com/android/internal/util/SyncResultReceiver.java +1 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ public final class SyncResultReceiver extends IResultReceiver.Stub { } /** @hide */ public static final class TimeoutException extends RuntimeException { public static final class TimeoutException extends Exception { private TimeoutException(String msg) { super(msg); } Loading Loading
core/java/android/app/contentsuggestions/ContentSuggestionsManager.java +8 −7 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public final class ContentSuggestionsManager { try { mService.provideContextBitmap(mUser, bitmap, imageContextRequestExtras); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -117,7 +117,7 @@ public final class ContentSuggestionsManager { try { mService.provideContextImage(mUser, taskId, imageContextRequestExtras); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading Loading @@ -146,7 +146,7 @@ public final class ContentSuggestionsManager { mService.suggestContentSelections( mUser, request, new SelectionsCallbackWrapper(callback, callbackExecutor)); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -173,7 +173,7 @@ public final class ContentSuggestionsManager { mService.classifyContentSelections( mUser, request, new ClassificationsCallbackWrapper(callback, callbackExecutor)); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -193,7 +193,7 @@ public final class ContentSuggestionsManager { try { mService.notifyInteraction(mUser, requestId, interaction); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -213,9 +213,10 @@ public final class ContentSuggestionsManager { mService.isEnabled(mUser, receiver); return receiver.getIntResult() != 0; } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get the enable status."); } return false; } /** Loading
core/java/android/view/autofill/AutofillManager.java +35 −16 Original line number Diff line number Diff line Loading @@ -751,6 +751,8 @@ public final class AutofillManager { } } catch (RemoteException e) { Log.e(TAG, "Could not figure out if there was an autofill session", e); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get session restore status: " + e); } } } Loading Loading @@ -864,7 +866,9 @@ public final class AutofillManager { mService.getFillEventHistory(receiver); return receiver.getParcelableResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get fill event history: " + e); return null; } } Loading Loading @@ -1477,10 +1481,13 @@ public final class AutofillManager { final SyncResultReceiver receiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS); try { mService.isServiceEnabled(mContext.getUserId(), mContext.getPackageName(), receiver); mService.isServiceEnabled(mContext.getUserId(), mContext.getPackageName(), receiver); return receiver.getIntResult() == 1; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get enabled autofill services status."); } } Loading @@ -1498,6 +1505,8 @@ public final class AutofillManager { return receiver.getParcelableResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get autofill services component name."); } } Loading @@ -1522,8 +1531,9 @@ public final class AutofillManager { mService.getUserDataId(receiver); return receiver.getStringResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get user data id for field classification."); } } Loading @@ -1544,8 +1554,9 @@ public final class AutofillManager { mService.getUserData(receiver); return receiver.getParcelableResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get user data for field classification."); } } Loading @@ -1561,7 +1572,7 @@ public final class AutofillManager { try { mService.setUserData(userData); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -1583,8 +1594,9 @@ public final class AutofillManager { mService.isFieldClassificationEnabled(receiver); return receiver.getIntResult() == 1; } catch (RemoteException e) { e.rethrowFromSystemServer(); return false; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get field classification enabled status."); } } Loading @@ -1606,8 +1618,9 @@ public final class AutofillManager { mService.getDefaultFieldClassificationAlgorithm(receiver); return receiver.getStringResult(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get default field classification algorithm."); } } Loading @@ -1627,8 +1640,9 @@ public final class AutofillManager { final String[] algorithms = receiver.getStringArrayResult(); return algorithms != null ? Arrays.asList(algorithms) : Collections.emptyList(); } catch (RemoteException e) { e.rethrowFromSystemServer(); return null; throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get available field classification algorithms."); } } Loading @@ -1651,6 +1665,8 @@ public final class AutofillManager { return receiver.getIntResult() == 1; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get autofill supported status."); } } Loading Loading @@ -2040,13 +2056,16 @@ public final class AutofillManager { } final SyncResultReceiver resultReceiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS); final int resultCode; int resultCode; try { mService.setAugmentedAutofillWhitelist(toList(packages), toList(activities), resultReceiver); resultCode = resultReceiver.getIntResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get the result of set AugmentedAutofill whitelist. " + e); return; } switch (resultCode) { case RESULT_OK: Loading Loading @@ -2283,7 +2302,7 @@ public final class AutofillManager { // In theory, we could ignore this error since it's not a big deal, but // in reality, we rather crash the app anyways, as the failure could be // a consequence of something going wrong on the server side... e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading Loading @@ -2661,7 +2680,7 @@ public final class AutofillManager { try { mService.onPendingSaveUi(operation, token); } catch (RemoteException e) { e.rethrowFromSystemServer(); Log.e(TAG, "Error in onPendingSaveUi: ", e); } } } Loading
core/java/android/view/contentcapture/ContentCaptureManager.java +32 −15 Original line number Diff line number Diff line Loading @@ -487,6 +487,8 @@ public final class ContentCaptureManager { return resultReceiver.getParcelableResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get service componentName."); } } Loading Loading @@ -516,6 +518,9 @@ public final class ContentCaptureManager { return resultReceiver.getParcelableResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get service settings componentName: " + e); return null; } } Loading Loading @@ -567,9 +572,13 @@ public final class ContentCaptureManager { final SyncResultReceiver resultReceiver = syncRun( (r) -> mService.getContentCaptureConditions(mContext.getPackageName(), r)); try { final ArrayList<ContentCaptureCondition> result = resultReceiver .getParcelableListResult(); return toSet(result); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get content capture conditions."); } } /** Loading Loading @@ -639,6 +648,8 @@ public final class ContentCaptureManager { public boolean isContentCaptureFeatureEnabled() { final SyncResultReceiver resultReceiver = syncRun( (r) -> mService.isContentCaptureFeatureEnabled(r)); try { final int resultCode = resultReceiver.getIntResult(); switch (resultCode) { case RESULT_CODE_TRUE: Loading @@ -649,6 +660,10 @@ public final class ContentCaptureManager { Log.wtf(TAG, "received invalid result: " + resultCode); return false; } } catch (SyncResultReceiver.TimeoutException e) { Log.e(TAG, "Fail to get content capture feature enable status: " + e); return false; } } /** Loading @@ -663,7 +678,7 @@ public final class ContentCaptureManager { try { mService.removeData(request); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading Loading @@ -691,7 +706,7 @@ public final class ContentCaptureManager { new DataShareAdapterDelegate(executor, dataShareWriteAdapter, mDataShareAdapterResourceManager)); } catch (RemoteException e) { e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading @@ -709,10 +724,12 @@ public final class ContentCaptureManager { if (resultCode == RESULT_CODE_SECURITY_EXCEPTION) { throw new SecurityException(resultReceiver.getStringResult()); } return resultReceiver; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (SyncResultReceiver.TimeoutException e) { throw new RuntimeException("Fail to get syn run result from SyncResultReceiver."); } return resultReceiver; } /** @hide */ Loading
core/java/com/android/internal/util/SyncResultReceiver.java +1 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ public final class SyncResultReceiver extends IResultReceiver.Stub { } /** @hide */ public static final class TimeoutException extends RuntimeException { public static final class TimeoutException extends Exception { private TimeoutException(String msg) { super(msg); } Loading