Skip to content

Commit

Permalink
282 - Adding package name to make intents explicit (#283)
Browse files Browse the repository at this point in the history
Ticket: #282

This commit:
- Adds package name to make intents explicit.
  • Loading branch information
latin-panda authored Jun 14, 2022
1 parent a385660 commit b879663
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public class ConnectionErrorActivity extends ClosableAppActivity {
// Retry connection
public void onClickRetry(View view) {
trace(this, "onClickRetry()");
sendBroadcast(new Intent("retryConnection"));
Intent intent = new Intent("retryConnection");
intent.setPackage(this.getPackageName());
sendBroadcast(intent);
showSpinnerLayout();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private Intent createResponseIntent() {
Intent requestIntent = getIntent();
String triggerClass = requestIntent == null ? null : requestIntent.getStringExtra(this.TRIGGER_CLASS);
Intent responseIntent = new Intent();
responseIntent.setPackage(this.getPackageName());
responseIntent.putExtra(this.TRIGGER_CLASS, triggerClass);
return responseIntent;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/medicmobile/webapp/mobile/UrlHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ private void startConnectionErrorActivity(WebView view, int errorCode, String er
trace(this, "onPageFinished() :: url: %s", url);
// Broadcast the event so if the connection error
// activity is listening it will close
this.parentActivity.sendBroadcast(new Intent("onPageFinished"));
Intent intent = new Intent("onPageFinished");
intent.setPackage(this.parentActivity.getPackageName());
this.parentActivity.sendBroadcast(intent);
}
}

0 comments on commit b879663

Please sign in to comment.