diff options
Diffstat (limited to 'java/com/android/dialer/main/impl')
-rw-r--r-- | java/com/android/dialer/main/impl/MainImpl.java | 34 | ||||
-rw-r--r-- | java/com/android/dialer/main/impl/res/values/strings.xml | 4 | ||||
-rw-r--r-- | java/com/android/dialer/main/impl/res/values/styles.xml | 4 |
3 files changed, 2 insertions, 40 deletions
diff --git a/java/com/android/dialer/main/impl/MainImpl.java b/java/com/android/dialer/main/impl/MainImpl.java index 1cd457c8a..717350e5f 100644 --- a/java/com/android/dialer/main/impl/MainImpl.java +++ b/java/com/android/dialer/main/impl/MainImpl.java @@ -16,23 +16,15 @@ package com.android.dialer.main.impl; -import android.annotation.TargetApi; import android.content.ComponentName; import android.content.Context; -import android.content.Intent; import android.content.pm.PackageManager; -import android.os.Build; -import android.os.Build.VERSION_CODES; -import android.support.v4.content.pm.ShortcutInfoCompat; -import android.support.v4.content.pm.ShortcutManagerCompat; -import android.support.v4.graphics.drawable.IconCompat; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.main.Main; import javax.inject.Inject; /** The entry point for the main feature. */ final class MainImpl implements Main { - private static final String SHORTCUT_KEY = "nui_launcher_shortcut"; @Inject MainImpl() {} @@ -45,11 +37,6 @@ final class MainImpl implements Main { @Override public void createNewUiLauncherShortcut(Context context) { enableComponent(context); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - createLauncherShortcutO(context); - } else { - createLauncherShortcutPreO(context); - } } /** @@ -75,25 +62,4 @@ final class MainImpl implements Main { PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } - - @TargetApi(VERSION_CODES.O) - private static void createLauncherShortcutO(Context context) { - ShortcutInfoCompat shortcutInfo = - new ShortcutInfoCompat.Builder(context, SHORTCUT_KEY) - .setIcon(IconCompat.createWithResource(context, R.drawable.nui_launcher_icon)) - .setIntent(MainActivity.getIntent(context)) - .setShortLabel(context.getString(R.string.nui_shortcut_name)) - .build(); - ShortcutManagerCompat.requestPinShortcut(context, shortcutInfo, null); - } - - private static void createLauncherShortcutPreO(Context context) { - Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); - intent.putExtra( - Intent.EXTRA_SHORTCUT_ICON, - Intent.ShortcutIconResource.fromContext(context, R.drawable.nui_launcher_icon)); - intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, context.getString(R.string.nui_shortcut_name)); - intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, MainActivity.getIntent(context)); - context.sendBroadcast(intent); - } } diff --git a/java/com/android/dialer/main/impl/res/values/strings.xml b/java/com/android/dialer/main/impl/res/values/strings.xml index 4e65432e5..121820383 100644 --- a/java/com/android/dialer/main/impl/res/values/strings.xml +++ b/java/com/android/dialer/main/impl/res/values/strings.xml @@ -18,10 +18,6 @@ <!-- Name of the main activity. --> <string name="main_activity_label" tools:ignore="UnusedResources">Phone</string> - <!-- Name of launcher shortcut for the new UI main activity. - TODO(38502365): Remove this once we're ready to launch the new UI. --> - <string name="nui_shortcut_name">Phone NUI</string> - <!-- Title for the activity that dials the phone, when launched directly into the dialpad --> <string name="dialpad_activity_title">Phone Keypad</string> diff --git a/java/com/android/dialer/main/impl/res/values/styles.xml b/java/com/android/dialer/main/impl/res/values/styles.xml index 47fdbac93..387b1d79e 100644 --- a/java/com/android/dialer/main/impl/res/values/styles.xml +++ b/java/com/android/dialer/main/impl/res/values/styles.xml @@ -46,12 +46,12 @@ <!-- Required for actionmode/multiselect to render properly. --> <!-- TODO(calderwoodra): Check to see if we can remove this after NewVoicemailFragment launches --> - <item name="actionModeStyle">@style/ActionModeStyle</item> + <item name="actionModeStyle">@style/NuiActionModeStyle</item> <item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item> </style> <!-- Colors our actionbar in action mode to dialer theme color. --> - <style name="ActionModeStyle" parent="@style/Widget.AppCompat.ActionMode"> + <style name="NuiActionModeStyle" parent="@style/Widget.AppCompat.ActionMode"> <item name="background">@color/dialer_theme_color</item> <item name="titleTextStyle">@style/ActionModeTitleTextStyle</item> </style> |