summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorBernardo Rufino <brufino@google.com>2018-09-19 10:21:02 +0100
committerBernardo Rufino <brufino@google.com>2018-09-25 15:49:43 +0100
commit1f1bae90736c3cb44f6d9b50db17151d664d680a (patch)
treeb774d7867cc2590ddfc4a8beb5454c39bd5e1221 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent3921b96ede045e7ca3d345f0053efebcc7220600 (diff)
[KV] Exceptions for error-handling
Added 2 exceptions: * TaskException: For what we used to call transport-level failures, these bring queue processing to a halt. * AgentException: For failures that happen due to the backup agent, these only prevent the backup of the current package, still allowing backup for the remaining packages in the queue. These are usually thrown deep in the call stack and caught in backupPackage() (and similarly backupPm()) and run(), the former for clean-up, where they are re-thrown and the latter for further processing where they are finally swallowed. The clean-up is more explicit now. This enabled further refactoring of backupPackage()/backupPm(), extractAgentData() and sendDataToTransport(). One change that I intend to revisit is reporting to the observer. Previously we used to detect some exceptional cases and set mStatus (which doesn't exist anymore) to other more general exceptional case and then in this general case handling report the success/failure to the observer. With the new exception-throwing model I changed this and the leaves are actually responsible for reporting success/failure to the observer (see changes in the reporter). This is to avoid too many changes in this CL. I'm entertaining the idea of extracting out package backup as a separate class and leave only queue-processing and generic bookkeeping to this class. Test: atest FrameworksServicesRoboTests Test: adb shell bmgr backupnow <kv_package> Change-Id: If3b1da7a5eb939e453f94fad76f5790696d1265a
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions