Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
devgianlu committed May 12, 2019
1 parent bd854bd commit a0dcd4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/gianlu/aria2app/LoadingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ protected void onCreate(Bundle savedInstanceState) {
for (MultiProfile profile : manager.getProfiles()) {
if (profile.isInAppDownloader()) {
connectToInAppDownloader(profile);
break;
return;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/gianlu/aria2app/ThisApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void stopAria2Service() {
aria2service.ui.stopService();
}

private static class Aria2UiDispatcher implements Aria2Ui.Listener {
private class Aria2UiDispatcher implements Aria2Ui.Listener {
private final Aria2Ui ui;
private final Set<Aria2Ui.Listener> listeners = new HashSet<>();
private volatile boolean lastUiState = false;
Expand All @@ -230,6 +230,9 @@ public void onMessage(@NonNull Aria2Ui.LogMessage msg) {

@Override
public void updateUi(boolean on) {
if (!lastUiState && on && Prefs.getBoolean(PK.A2_ENABLE_NOTIFS))
NotificationService.start(ThisApplication.this);

lastUiState = on;

for (Aria2Ui.Listener listener : new ArrayList<>(listeners))
Expand Down

0 comments on commit a0dcd4e

Please sign in to comment.