-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add notification update receiver * Fix bug in call activity intent
- Loading branch information
Showing
11 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
app/src/main/java/io/forsta/relay/receivers/NotificationUpdateReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.forsta.relay.receivers; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
public class NotificationUpdateReceiver extends BroadcastReceiver { | ||
private static final String TAG = io.forsta.librelay.notifications.NotificationUpdateReceiver.class.getSimpleName(); | ||
|
||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
Log.w(TAG, "Received notification update"); | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
librelay/src/io/forsta/librelay/notifications/NotificationUpdateReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.forsta.librelay.notifications; | ||
|
||
import android.app.PendingIntent; | ||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
import io.forsta.librelay.BuildConfig; | ||
|
||
public class NotificationUpdateReceiver extends BroadcastReceiver { | ||
private static final String TAG = NotificationUpdateReceiver.class.getSimpleName(); | ||
|
||
public static final String UPDATE_ACTION = BuildConfig.APPLICATION_ID + "." + BuildConfig.FLAVOR + ".notifications.UPDATE"; | ||
public static final String THREAD_ID = "thread_id"; | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
Log.w(TAG, "Notification update received"); | ||
long threadId = intent.getLongExtra(THREAD_ID, -1); | ||
if (threadId > 0) { | ||
MessageNotifier.updateNotification(context, threadId); | ||
} else { | ||
MessageNotifier.updateNotification(context); | ||
} | ||
} | ||
|
||
public static Intent getUpdateIntent(Context context, long threadId) { | ||
Intent intent = new Intent(UPDATE_ACTION); | ||
intent.putExtra(ReplyReceiver.THREAD_ID, threadId); | ||
intent.setPackage(context.getPackageName()); | ||
return intent; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters