@@ -1259,34 +1259,27 @@ protected void startFlashing() {
1259
1259
@ Override
1260
1260
public void run () {
1261
1261
prepareToFlashResult = prepareToFlash ();
1262
- switch ( prepareToFlashResult ) {
1263
- case 0 : {
1264
- startPartialFlash ();
1265
- break ;
1266
- }
1267
- case 1 : {
1268
- runOnUiThread (new Runnable () {
1269
- @ Override
1270
- public void run () {
1262
+ runOnUiThread (new Runnable () {
1263
+ @ Override
1264
+ public void run () {
1265
+ switch (prepareToFlashResult ) {
1266
+ case 0 :
1267
+ startPartialFlash ();
1268
+ break ;
1269
+ case 1 :
1271
1270
PopUp .hide ();
1272
1271
popupHexNotCompatible ();
1273
- }
1274
- });
1275
- break ;
1276
- }
1277
- case 2 : {
1278
- runOnUiThread (new Runnable () {
1279
- @ Override
1280
- public void run () {
1272
+ break ;
1273
+ case 2 :
1281
1274
PopUp .hide ();
1282
1275
popupFailedToCreateFiles ();
1283
- }
1284
- });
1285
- break ;
1276
+ break ;
1277
+ }
1286
1278
}
1287
- }
1279
+ });
1288
1280
}
1289
1281
}).start ();
1282
+ logi ("startFlashing End" );
1290
1283
}
1291
1284
1292
1285
protected void popupHexNotCompatible () {
@@ -1402,13 +1395,6 @@ public void startDFUFlash() {
1402
1395
1403
1396
protected void startPartialFlash () {
1404
1397
logi ("startPartialFlash" );
1405
- PopUp .hide ();
1406
- PopUp .show (getString (R .string .dfu_status_starting_msg ),
1407
- "" ,
1408
- R .drawable .flash_face , R .drawable .blue_btn ,
1409
- PopUp .GIFF_ANIMATION_FLASH ,
1410
- TYPE_SPINNER_NOT_CANCELABLE ,
1411
- null , null );
1412
1398
1413
1399
MBApp application = MBApp .getApp ();
1414
1400
ConnectedDevice currentMicrobit = BluetoothUtils .getPairedMicrobit (this );
@@ -1425,6 +1411,7 @@ protected void startPartialFlash() {
1425
1411
service .putExtra ("hardwareType" , hardwareType ); // a path or URI must be provided.
1426
1412
service .putExtra ("pf" , true ); // Enable partial flashing
1427
1413
application .startService (service );
1414
+ logi ("startPartialFlash End" );
1428
1415
}
1429
1416
1430
1417
@@ -1900,8 +1887,8 @@ public void onReceive(Context context, Intent intent) {
1900
1887
MBApp application = MBApp .getApp ();
1901
1888
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager .getInstance (application );
1902
1889
1903
- String message = "Broadcast intent detected " + intent .getAction ();
1904
- logi ("PFResultReceiver.onReceive :: " + message );
1890
+ String action = intent .getAction ();
1891
+ logi ("PFResultReceiver.onReceive :: action " + action );
1905
1892
if (intent .getAction ().equals (PartialFlashingService .BROADCAST_PROGRESS )) {
1906
1893
// Update UI
1907
1894
Intent progressUpdate = new Intent ();
@@ -1986,8 +1973,8 @@ public void onClick(View v) {
1986
1973
1987
1974
@ Override
1988
1975
public void onReceive (Context context , Intent intent ) {
1989
- String message = "Broadcast intent detected " + intent .getAction ();
1990
- logi ("DFUResultReceiver.onReceive :: " + message );
1976
+ String action = intent .getAction ();
1977
+ logi ("DFUResultReceiver.onReceive :: action " + action );
1991
1978
if (intent .getAction ().equals (DfuService .BROADCAST_PROGRESS )) {
1992
1979
int state = intent .getIntExtra (DfuService .EXTRA_DATA , 0 );
1993
1980
if (state < 0 ) {
0 commit comments