diff options
author | calderwoodra <calderwoodra@google.com> | 2018-03-15 15:56:30 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-15 15:59:02 -0700 |
commit | e760e4204887acd9fb6e4b8b00059659a1367c3b (patch) | |
tree | 24876ae821f27b5238d5c72c17db16b04e7d7871 /java/com/android/dialer/main | |
parent | e1c143a195540baf5ddc2525129ced08cddccbc0 (diff) |
Resolve all build resource conflicts.
For simplicity, instead of resolve the nui shortcut string, I
deleted it since it isn't used anymore.
Test: build log
PiperOrigin-RevId: 189260472
Change-Id: I67d5a49d78916a8960e41ad1c7b7f59efad6d718
Diffstat (limited to 'java/com/android/dialer/main')
-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> |