|
|
|
@ -19,6 +19,7 @@ package eu.faircode.email;
|
|
|
|
|
Copyright 2018 by Marcel Bokhorst (M66B)
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import android.Manifest;
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.app.PendingIntent;
|
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
@ -28,6 +29,7 @@ import android.content.Intent;
|
|
|
|
|
import android.content.IntentFilter;
|
|
|
|
|
import android.content.IntentSender;
|
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
|
import android.content.pm.ShortcutInfo;
|
|
|
|
|
import android.content.pm.ShortcutManager;
|
|
|
|
|
import android.content.res.Configuration;
|
|
|
|
@ -101,6 +103,7 @@ import androidx.annotation.NonNull;
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
import androidx.appcompat.app.ActionBarDrawerToggle;
|
|
|
|
|
import androidx.constraintlayout.widget.Group;
|
|
|
|
|
import androidx.core.content.ContextCompat;
|
|
|
|
|
import androidx.drawerlayout.widget.DrawerLayout;
|
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
@ -718,8 +721,11 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
|
|
|
|
|
|
ShortcutManager sm = (ShortcutManager) getSystemService(Context.SHORTCUT_SERVICE);
|
|
|
|
|
|
|
|
|
|
Cursor cursor = null;
|
|
|
|
|
List<ShortcutInfo> shortcuts = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS)
|
|
|
|
|
== PackageManager.PERMISSION_GRANTED) {
|
|
|
|
|
Cursor cursor = null;
|
|
|
|
|
try {
|
|
|
|
|
// https://developer.android.com/guide/topics/providers/contacts-provider#ObsoleteData
|
|
|
|
|
cursor = getContentResolver().query(
|
|
|
|
@ -785,6 +791,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
|
if (cursor != null)
|
|
|
|
|
cursor.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sm.setDynamicShortcuts(shortcuts);
|
|
|
|
|
}
|
|
|
|
|