Skip to content

Commit

Permalink
API34 receivers
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesSmartCell committed Nov 30, 2024
1 parent d5e10c2 commit e20df25
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@
android:usesCleartextTraffic="true"
tools:replace="android:name, android:theme, android:allowBackup">


<receiver android:name=".entity.HomeReceiver"
android:exported="false">
<intent-filter>
<action android:name="C.REQUEST_NOTIFICATION_ACCESS" />
<action android:name="C.BACKUP_WALLET_SUCCESS" />
</intent-filter>
</receiver>

<receiver android:name=".entity.FinishReceiver"
android:exported="false">
<intent-filter>
<action android:name="C.PRUNE_ACTIVITY" />
</intent-filter>
</receiver>

<activity
android:name=".ui.HomeActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import com.alphawallet.app.C;
import com.alphawallet.app.R;
import com.alphawallet.app.entity.HomeReceiver;
import com.alphawallet.app.ui.HomeActivity;

/**
Expand Down Expand Up @@ -148,6 +149,7 @@ private void checkNotificationPermission()
!= PackageManager.PERMISSION_DENIED))
{
Intent intent = new Intent(C.REQUEST_NOTIFICATION_ACCESS);
intent.setPackage("com.alphawallet.app.entity.HomeReceiver");
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ private void onBurned(Boolean burn)
dialog.setTitle(R.string.ticket_redeemed);
dialog.setIcon(AWalletAlertDialog.SUCCESS);
dialog.setOnDismissListener(v -> {
Intent pruneIntent = new Intent(PRUNE_ACTIVITY);
pruneIntent.setPackage("com.alphawallet.app.entity.FinishReceiver");
LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(PRUNE_ACTIVITY));
});
dialog.show();
Expand Down

0 comments on commit e20df25

Please sign in to comment.