diff options
author | Zhomart Mukhamejanov <zhomart@google.com> | 2018-04-23 20:38:54 +0200 |
---|---|---|
committer | Zhomart Mukhamejanov <zhomart@google.com> | 2018-05-08 23:12:33 +0200 |
commit | 0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92 (patch) | |
tree | 54ee79783c840c9dea16973abeb99602aef66881 /updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java | |
parent | Merge "recovery: Remove unneeded include of minui.h." (diff) | |
download | android_bootable_recovery-0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92.tar android_bootable_recovery-0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92.tar.gz android_bootable_recovery-0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92.tar.bz2 android_bootable_recovery-0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92.tar.lz android_bootable_recovery-0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92.tar.xz android_bootable_recovery-0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92.tar.zst android_bootable_recovery-0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92.zip |
Diffstat (limited to 'updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java')
-rw-r--r-- | updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java b/updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java index d6a6ce3f5..359e2b10c 100644 --- a/updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java +++ b/updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java @@ -34,6 +34,7 @@ import android.widget.Toast; import com.example.android.systemupdatersample.PayloadSpec; import com.example.android.systemupdatersample.R; import com.example.android.systemupdatersample.UpdateConfig; +import com.example.android.systemupdatersample.services.PrepareStreamingService; import com.example.android.systemupdatersample.util.PayloadSpecs; import com.example.android.systemupdatersample.util.UpdateConfigs; import com.example.android.systemupdatersample.util.UpdateEngineErrorCodes; @@ -297,6 +298,17 @@ public class MainActivity extends Activity { updateEngineApplyPayload(payload); } else { Log.d(TAG, "Starting PrepareStreamingService"); + PrepareStreamingService.startService(this, config, (code, payloadSpec) -> { + if (code == PrepareStreamingService.RESULT_CODE_SUCCESS) { + updateEngineApplyPayload(payloadSpec); + } else { + Log.e(TAG, "PrepareStreamingService failed, result code is " + code); + Toast.makeText( + MainActivity.this, + "PrepareStreamingService failed, result code is " + code, + Toast.LENGTH_LONG).show(); + } + }); } } |