Skip to content

Commit

Permalink
Merge pull request #42 from martinwork/from300
Browse files Browse the repository at this point in the history
Pairing - fix PAIR NEW crash
  • Loading branch information
martinwork authored Mar 27, 2024
2 parents d189b83 + bf71422 commit b90cacc
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private enum PAIRING_STATE {
public final static String ACTION_RESET_TO_BLE = "com.samsung.microbit.ACTION_RESET_TO_BLE";
public final static String ACTION_PAIR_BEFORE_FLASH = "com.samsung.microbit.ACTION_PAIR_BEFORE_FLASH";

private String inAction = null;
private String inAction = "";

@Override
protected void onNewIntent(Intent intent) {
Expand All @@ -167,15 +167,16 @@ protected void onNewIntent(Intent intent) {

private void handleIncomingIntent(Intent intent) {
inAction = intent.getAction();
if ( inAction != null) {
if ( inAction.equals(ACTION_RESET_TO_BLE)) {
resetToBLEStart();
return;
}
if ( inAction.equals(ACTION_PAIR_BEFORE_FLASH)) {
pairBeforeFlashStart();
return;
}
if ( inAction == null) {
inAction = "";
}
if ( inAction.equals(ACTION_RESET_TO_BLE)) {
resetToBLEStart();
return;
}
if ( inAction.equals(ACTION_PAIR_BEFORE_FLASH)) {
pairBeforeFlashStart();
return;
}
}

Expand All @@ -184,7 +185,7 @@ private void resetToBLEStart() {
}

private void resetToBLEFinish( int resultCode) {
inAction = null;
inAction = "";
setResult( resultCode);
finish();
}
Expand All @@ -194,7 +195,7 @@ private void pairBeforeFlashStart() {
}

private void pairBeforeFlashFinish( int resultCode) {
inAction = null;
inAction = "";
setResult( resultCode);
finish();
}
Expand Down

0 comments on commit b90cacc

Please sign in to comment.