Fix open from homescreen shortcut

This commit is contained in:
luvletter2333 2021-09-20 22:56:28 +08:00
parent 03db127ae1
commit d5188d73f9
No known key found for this signature in database
GPG Key ID: BFD68B892BECC1D8
1 changed files with 10 additions and 2 deletions

View File

@ -29,8 +29,16 @@ public class OpenChatReceiver extends Activity {
return;
}
try {
long chatId = intent.getLongExtra("chatId", 0);
long userId = intent.getLongExtra("userId", 0);
long chatId;
long userId;
try {
chatId = intent.getLongExtra("chatId", 0);
userId = intent.getLongExtra("userId", 0);
} catch (ClassCastException castException){
chatId = intent.getIntExtra("chatId", 0);
userId = intent.getIntExtra("userId", 0);
// A temporary fix for 8.0.1 update, should be reverted when official fix this
}
int encId = intent.getIntExtra("encId", 0);
if (chatId == 0 && userId == 0 && encId == 0) {
return;