summaryrefslogtreecommitdiffstats
path: root/updater_sample/src/com/example/android/systemupdatersample/ui/MainActivity.java
diff options
context:
space:
mode:
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.java12
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();
+ }
+ });
}
}