diff --git a/src/com/android/contacts/DynamicShortcuts.java b/src/com/android/contacts/DynamicShortcuts.java
index c7d8456..0901e56 100644
--- a/src/com/android/contacts/DynamicShortcuts.java
+++ b/src/com/android/contacts/DynamicShortcuts.java
@@ -67,7 +67,7 @@
  * Currently it adds shortcuts for the top 3 contacts in the {@link Contacts#CONTENT_STREQUENT_URI}
  *
  * Usage: DynamicShortcuts.initialize should be called during Application creation. This will
- * schedule a Job to keep the shortcuts up-to-date so no further interations should be necessary.
+ * schedule a Job to keep the shortcuts up-to-date so no further interactions should be necessary.
  */
 @TargetApi(Build.VERSION_CODES.N_MR1)
 public class DynamicShortcuts {
@@ -289,11 +289,21 @@
         return builder;
     }
 
+    public ShortcutInfo getQuickContactShortcutInfo(long id, String lookupKey, String displayName) {
+        final ShortcutInfo.Builder builder = builderForContactShortcut(id, lookupKey, displayName);
+        addIconForContact(id, lookupKey, displayName, builder);
+        return builder.build();
+    }
+
     private void addIconForContact(Cursor cursor, ShortcutInfo.Builder builder) {
         final long id = cursor.getLong(0);
         final String lookupKey = cursor.getString(1);
         final String displayName = cursor.getString(2);
+        addIconForContact(id, lookupKey, displayName, builder);
+    }
 
+    private void addIconForContact(long id, String lookupKey, String displayName,
+            ShortcutInfo.Builder builder) {
         final Bitmap bitmap = getContactPhoto(id);
         if (bitmap != null) {
             builder.setIcon(Icon.createWithBitmap(bitmap));
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 2007e10..e0986d5 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -35,6 +35,7 @@
 import android.content.Loader;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.content.pm.ShortcutManager;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
@@ -74,6 +75,7 @@
 import android.support.v4.app.ActivityCompat;
 import android.support.v4.content.LocalBroadcastManager;
 import android.support.v4.content.res.ResourcesCompat;
+import android.support.v4.os.BuildCompat;
 import android.support.v7.graphics.Palette;
 import android.telecom.PhoneAccount;
 import android.telecom.TelecomManager;
@@ -2645,22 +2647,32 @@
 
                     @Override
                     public void onShortcutIntentCreated(Uri uri, Intent shortcutIntent) {
-                        // Broadcast the shortcutIntent to the launcher to create a
-                        // shortcut to this contact
-                        shortcutIntent.setAction(ACTION_INSTALL_SHORTCUT);
-                        QuickContactActivity.this.sendBroadcast(shortcutIntent);
-
-                        // Send a toast to give feedback to the user that a shortcut to this
-                        // contact was added to the launcher.
-                        final String displayName = shortcutIntent
-                                .getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
-                        final String toastMessage = TextUtils.isEmpty(displayName)
-                                ? getString(R.string.createContactShortcutSuccessful_NoName)
-                                : getString(R.string.createContactShortcutSuccessful, displayName);
-                        Toast.makeText(QuickContactActivity.this, toastMessage,
-                                Toast.LENGTH_SHORT).show();
+                        if (BuildCompat.isAtLeastO()) {
+                            final ShortcutManager shortcutManager = (ShortcutManager)
+                                    getSystemService(SHORTCUT_SERVICE);
+                            final DynamicShortcuts shortcuts =
+                                    new DynamicShortcuts(QuickContactActivity.this);
+                            shortcutManager.requestPinShortcut(
+                                    shortcuts.getQuickContactShortcutInfo(
+                                            mContactData.getId(), mContactData.getLookupKey(),
+                                            mContactData.getDisplayName()), null);
+                        } else {
+                            // Broadcast the shortcutIntent to the launcher to create a
+                            // shortcut to this contact
+                            shortcutIntent.setAction(ACTION_INSTALL_SHORTCUT);
+                            QuickContactActivity.this.sendBroadcast(shortcutIntent);
+                            // Send a toast to give feedback to the user that a shortcut to this
+                            // contact was added to the launcher.
+                            final String displayName = shortcutIntent
+                                    .getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
+                            final String toastMessage = TextUtils.isEmpty(displayName)
+                                    ? getString(R.string.createContactShortcutSuccessful_NoName)
+                                    : getString(R.string.createContactShortcutSuccessful,
+                                            displayName);
+                            Toast.makeText(QuickContactActivity.this, toastMessage,
+                                    Toast.LENGTH_SHORT).show();
+                        }
                     }
-
                 });
         builder.createContactShortcutIntent(mContactData.getLookupUri());
     }
@@ -2670,6 +2682,13 @@
                 mContactData.isDirectoryEntry()) {
             return false;
         }
+
+        if (BuildCompat.isAtLeastO()) {
+            final ShortcutManager manager = (ShortcutManager)
+                    getSystemService(Context.SHORTCUT_SERVICE);
+            return manager.isRequestPinShortcutSupported();
+        }
+
         final Intent createShortcutIntent = new Intent();
         createShortcutIntent.setAction(ACTION_INSTALL_SHORTCUT);
         final List<ResolveInfo> receivers = getPackageManager()
