summaryrefslogtreecommitdiffstats
path: root/updater_sample/src/com/example/android/systemupdatersample/services
diff options
context:
space:
mode:
authorZhomart Mukhamejanov <zhomart@google.com>2018-05-18 19:22:13 +0200
committerZhomart Mukhamejanov <zhomart@google.com>2018-05-18 19:38:33 +0200
commitb0361ffa3e25ab3e234a5ccaa5587b7dca88de76 (patch)
treedc99362d4eb95196eec3ceab8aafe88124c066a0 /updater_sample/src/com/example/android/systemupdatersample/services
parentMerge "recovery: Reset optind to 1 after getopt" (diff)
downloadandroid_bootable_recovery-b0361ffa3e25ab3e234a5ccaa5587b7dca88de76.tar
android_bootable_recovery-b0361ffa3e25ab3e234a5ccaa5587b7dca88de76.tar.gz
android_bootable_recovery-b0361ffa3e25ab3e234a5ccaa5587b7dca88de76.tar.bz2
android_bootable_recovery-b0361ffa3e25ab3e234a5ccaa5587b7dca88de76.tar.lz
android_bootable_recovery-b0361ffa3e25ab3e234a5ccaa5587b7dca88de76.tar.xz
android_bootable_recovery-b0361ffa3e25ab3e234a5ccaa5587b7dca88de76.tar.zst
android_bootable_recovery-b0361ffa3e25ab3e234a5ccaa5587b7dca88de76.zip
Diffstat (limited to 'updater_sample/src/com/example/android/systemupdatersample/services')
-rw-r--r--updater_sample/src/com/example/android/systemupdatersample/services/PrepareStreamingService.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/updater_sample/src/com/example/android/systemupdatersample/services/PrepareStreamingService.java b/updater_sample/src/com/example/android/systemupdatersample/services/PrepareStreamingService.java
index 222bb0a58..ac6e223e3 100644
--- a/updater_sample/src/com/example/android/systemupdatersample/services/PrepareStreamingService.java
+++ b/updater_sample/src/com/example/android/systemupdatersample/services/PrepareStreamingService.java
@@ -116,6 +116,8 @@ public class PrepareStreamingService extends IntentService {
PackageFiles.PAYLOAD_PROPERTIES_FILE_NAME
);
+ private final PayloadSpecs mPayloadSpecs = new PayloadSpecs();
+
@Override
protected void onHandleIntent(Intent intent) {
Log.d(TAG, "On handle intent is called");
@@ -137,7 +139,7 @@ public class PrepareStreamingService extends IntentService {
* 3. Checks OTA package compatibility with the device.
* 4. Constructs {@link PayloadSpec} for streaming update.
*/
- private static PayloadSpec execute(UpdateConfig config)
+ private PayloadSpec execute(UpdateConfig config)
throws IOException, PreparationFailedException {
downloadPreStreamingFiles(config, OTA_PACKAGE_DIR);
@@ -164,7 +166,7 @@ public class PrepareStreamingService extends IntentService {
}
}
- return PayloadSpecs.forStreaming(config.getUrl(),
+ return mPayloadSpecs.forStreaming(config.getUrl(),
payloadBinary.get().getOffset(),
payloadBinary.get().getSize(),
Paths.get(OTA_PACKAGE_DIR, PAYLOAD_PROPERTIES_FILE_NAME).toFile());
@@ -176,7 +178,7 @@ public class PrepareStreamingService extends IntentService {
* in directory {@code dir}.
* @throws IOException when can't download a file
*/
- private static void downloadPreStreamingFiles(UpdateConfig config, String dir)
+ private void downloadPreStreamingFiles(UpdateConfig config, String dir)
throws IOException {
Log.d(TAG, "Deleting existing files from " + dir);
for (String file : PRE_STREAMING_FILES_SET) {
@@ -200,7 +202,7 @@ public class PrepareStreamingService extends IntentService {
* @param file physical location of {@link PackageFiles#COMPATIBILITY_ZIP_FILE_NAME}
* @return true if OTA package is compatible with this device
*/
- private static boolean verifyPackageCompatibility(File file) {
+ private boolean verifyPackageCompatibility(File file) {
try {
return RecoverySystem.verifyPackageCompatibility(file);
} catch (IOException e) {