From 68d86c656e5522dec1b04e85ebc0e0f78e436c3d Mon Sep 17 00:00:00 2001 From: Sailesh Nepal Date: Sun, 21 Feb 2016 11:41:28 -0800 Subject: [Gradle] Allow dialer to be compiled as a library This CL adds a new build-library.gradle file for AOSP dialer. This allows the dialer to be built as a library that can be included from GoogleDialer. Switching to a library project meant making two other changes: - changed all switch statements that used resources to if statements. This was required because resource IDs are not final in library projects. - changed InCalUI code to import com.android.dialer.R instead of com.android.incallui.R. See http://b.android.com/82743 for more info on why this is required. src-N isn't supported yet. Also, this isn't the ideal project layout. In the future we should consider switching to the following layout: - dialer/incallui/ <- incall UI as an independent library project - dialer/dialerlib/ <- dialer code as an independent library project - dialer/app <- skelent app that builds a standalone dialer AOSP app Bug: 26676586 Change-Id: I07fbee4d33cc683539e4f8b3953c93f1427af9d7 --- .../com/android/incallui/StatusBarNotifier.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'InCallUI/src/com/android/incallui/StatusBarNotifier.java') diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 6c00164b9..1a4ec0935 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -50,6 +50,7 @@ import com.android.contacts.common.preference.ContactsPreferences; import com.android.contacts.common.testing.NeededForTesting; import com.android.contacts.common.util.BitmapUtil; import com.android.contacts.common.util.ContactDisplayUtils; +import com.android.dialer.R; import com.android.incallui.Call.State; import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.ContactInfoCache.ContactInfoCacheCallback; @@ -520,17 +521,16 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, } private static int getWorkStringFromPersonalString(int resId) { - switch(resId) { - case R.string.notification_ongoing_call: - return R.string.notification_ongoing_work_call; - case R.string.notification_ongoing_call_wifi: - return R.string.notification_ongoing_work_call_wifi; - case R.string.notification_incoming_call_wifi: - return R.string.notification_incoming_work_call_wifi; - case R.string.notification_incoming_call: - return R.string.notification_incoming_work_call; - default: - return resId; + if (resId == R.string.notification_ongoing_call) { + return R.string.notification_ongoing_work_call; + } else if (resId == R.string.notification_ongoing_call_wifi) { + return R.string.notification_ongoing_work_call_wifi; + } else if (resId == R.string.notification_incoming_call_wifi) { + return R.string.notification_incoming_work_call_wifi; + } else if (resId == R.string.notification_incoming_call) { + return R.string.notification_incoming_work_call; + } else { + return resId; } } -- cgit v1.2.3