Create a fake Framework dependency for Dialer.
It enableds Dialer to run without a bluetooth connected device.
Test: manual
Bug: 159769480
Change-Id: I69cbf865e5b1cf454489dbb5432f16b1002cc6b0
diff --git a/Android.bp b/Android.bp
index b5ef35f..2f5be41 100644
--- a/Android.bp
+++ b/Android.bp
@@ -13,7 +13,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-
android_app {
name: "CarDialerApp",
@@ -30,6 +29,7 @@
libs: ["android.car"],
static_libs: [
+ "car-dialer-framework-dep",
"androidx.recyclerview_recyclerview",
"androidx.lifecycle_lifecycle-extensions",
"androidx.preference_preference",
@@ -88,6 +88,7 @@
libs: ["android.car"],
static_libs: [
+ "car-dialer-fake-framework-dep",
"androidx.recyclerview_recyclerview",
"androidx.lifecycle_lifecycle-extensions",
"androidx.preference_preference",
@@ -125,6 +126,16 @@
enabled: false,
},
},
+
+ // runtime cc library which is used by mockito-target-extended.
+ jni_libs: [
+ // For mockito extended
+ "libdexmakerjvmtiagent",
+ "libstaticjvmtiagent",
+ ],
+
+ // Enforce the jni libraries to be grouped into the APK file.
+ use_embedded_native_libs: true,
}
//##################################################################################
diff --git a/framework/Android.bp b/framework/Android.bp
new file mode 100644
index 0000000..ea85650
--- /dev/null
+++ b/framework/Android.bp
@@ -0,0 +1,42 @@
+//
+// Copyright (C) 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Choose only one dependency to depend on.
+
+// A library that wires Dialer with a real Android Framework implementation.
+android_library {
+ name: "car-dialer-framework-dep",
+ // required to access any private API.
+ platform_apis: true,
+
+ srcs: ["src/**/*.java", "real/src/**/*java"],
+}
+
+// A library that connects with a fake Android Framework implementation.
+// Link against this dependency will allow Dialer app to run without a paired phone.
+android_library {
+ name: "car-dialer-fake-framework-dep",
+
+ // required to access any private API and spy() on any framework class.
+ platform_apis: true,
+
+ srcs: ["src/**/*.java", "fake/src/**/*java"],
+
+ static_libs: [
+ "mockito-target-extended-minus-junit4",
+ ],
+
+}
\ No newline at end of file
diff --git a/framework/AndroidManifest.xml b/framework/AndroidManifest.xml
new file mode 100644
index 0000000..d25adb2
--- /dev/null
+++ b/framework/AndroidManifest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.dialer.framework">
+ <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29"/>
+
+ <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
+ <uses-permission android:name="android.permission.READ_CONTACTS"/>
+
+ <application android:debuggable="true"/>
+</manifest>
\ No newline at end of file
diff --git a/framework/fake/src/com/android/car/dialer/framework/AndroidFrameworkImpl.java b/framework/fake/src/com/android/car/dialer/framework/AndroidFrameworkImpl.java
new file mode 100644
index 0000000..3b45e47
--- /dev/null
+++ b/framework/fake/src/com/android/car/dialer/framework/AndroidFrameworkImpl.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.car.dialer.framework;
+
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+
+/**
+ * A fake implementation of Android framework services provider.
+ */
+public class AndroidFrameworkImpl implements AndroidFramework {
+
+ private static AndroidFrameworkImpl sFakeAndroidFramework;
+
+ private FakeBluetoothAdapter mFakeBluetoothAdapter = new FakeBluetoothAdapter();
+ private BluetoothAdapter mSpiedBluetoothAdapter;
+
+ /**
+ * Returns the single instance of {@link AndroidFrameworkImpl}.
+ */
+ public static AndroidFrameworkImpl get() {
+ if (sFakeAndroidFramework == null) {
+ sFakeAndroidFramework = new AndroidFrameworkImpl();
+ }
+
+ return sFakeAndroidFramework;
+ }
+
+ private AndroidFrameworkImpl() {
+ mSpiedBluetoothAdapter = mFakeBluetoothAdapter.getBluetoothAdapter();
+ }
+
+ /**
+ * Virtually connect a Bluetooth phone to the fake framework.
+ */
+ public void connectBluetoothPhone() {
+ BluetoothDevice device = mock(BluetoothDevice.class);
+ mFakeBluetoothAdapter.connectHfpDevice(device);
+ }
+
+ @Override
+ public BluetoothAdapter getBluetoothAdapter() {
+ return mSpiedBluetoothAdapter;
+ }
+}
diff --git a/framework/fake/src/com/android/car/dialer/framework/FakeBluetoothAdapter.java b/framework/fake/src/com/android/car/dialer/framework/FakeBluetoothAdapter.java
new file mode 100644
index 0000000..ace8bba
--- /dev/null
+++ b/framework/fake/src/com/android/car/dialer/framework/FakeBluetoothAdapter.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.car.dialer.framework;
+
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.spy;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.when;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothProfile;
+import android.util.ArraySet;
+
+import java.util.Set;
+
+/**
+ * A fake BluetoothAdapter implementation.
+ */
+public class FakeBluetoothAdapter {
+ private boolean mIsEnabled = true;
+ private int mHfpProfileConnectionState = BluetoothProfile.STATE_DISCONNECTED;
+ private Set<BluetoothDevice> mConnectedBluetoothDevices = new ArraySet<>();
+
+ private BluetoothAdapter mSpiedBluetoothAdapter;
+
+ public FakeBluetoothAdapter() {
+ mSpiedBluetoothAdapter = spy(BluetoothAdapter.getDefaultAdapter());
+ updateFake();
+ }
+
+ /**
+ * Virtually connect a BluetoothDevice. Calling this function will update the Bluetooth state.
+ */
+ public void connectHfpDevice(BluetoothDevice device) {
+ mHfpProfileConnectionState = BluetoothProfile.STATE_CONNECTED;
+ mConnectedBluetoothDevices.add(device);
+ updateFake();
+ }
+
+ /**
+ * Gets a fake BluetoothAdapter.
+ */
+ public BluetoothAdapter getBluetoothAdapter() {
+ return mSpiedBluetoothAdapter;
+ }
+
+ private void updateFake() {
+ when(mSpiedBluetoothAdapter.isEnabled()).thenReturn(mIsEnabled);
+ doReturn(mHfpProfileConnectionState).when(mSpiedBluetoothAdapter)
+ .getProfileConnectionState(BluetoothProfile.HEADSET_CLIENT);
+ when(mSpiedBluetoothAdapter.getBondedDevices()).thenReturn(mConnectedBluetoothDevices);
+ }
+}
diff --git a/framework/real/src/com/android/car/dialer/framework/AndroidFrameworkImpl.java b/framework/real/src/com/android/car/dialer/framework/AndroidFrameworkImpl.java
new file mode 100644
index 0000000..f2720bf
--- /dev/null
+++ b/framework/real/src/com/android/car/dialer/framework/AndroidFrameworkImpl.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.car.dialer.framework;
+
+import android.bluetooth.BluetoothAdapter;
+
+/**
+ * A real implementation of Android framework services provider.
+ */
+public class AndroidFrameworkImpl implements AndroidFramework {
+ private static AndroidFrameworkImpl sRealAndroidFramework;
+
+ /**
+ * Returns the single instance of AndroidFrameworkImpl.
+ */
+ public static AndroidFrameworkImpl get() {
+ if (sRealAndroidFramework == null) {
+ sRealAndroidFramework = new AndroidFrameworkImpl();
+ }
+
+ return sRealAndroidFramework;
+ }
+
+ @Override
+ public BluetoothAdapter getBluetoothAdapter() {
+ return BluetoothAdapter.getDefaultAdapter();
+ }
+}
diff --git a/framework/src/com/android/car/dialer/framework/AndroidFramework.java b/framework/src/com/android/car/dialer/framework/AndroidFramework.java
new file mode 100644
index 0000000..dde88ba
--- /dev/null
+++ b/framework/src/com/android/car/dialer/framework/AndroidFramework.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.car.dialer.framework;
+
+import android.bluetooth.BluetoothAdapter;
+
+/**
+ * A provider which provides all kinds of Android framework services.
+ */
+public interface AndroidFramework {
+
+ /**
+ * Returns a {@link BluetoothAdapter}.
+ */
+ BluetoothAdapter getBluetoothAdapter();
+}
diff --git a/src/com/android/car/dialer/DialerApplication.java b/src/com/android/car/dialer/DialerApplication.java
index 0b9faf0..95814aa 100644
--- a/src/com/android/car/dialer/DialerApplication.java
+++ b/src/com/android/car/dialer/DialerApplication.java
@@ -19,8 +19,10 @@
import android.app.Application;
import com.android.car.dialer.bluetooth.UiBluetoothMonitor;
+import com.android.car.dialer.framework.AndroidFrameworkImpl;
import com.android.car.dialer.notification.InCallNotificationController;
import com.android.car.dialer.notification.MissedCallNotificationController;
+import com.android.car.dialer.servicelocator.DialerServiceLocator;
import com.android.car.dialer.telecom.UiCallManager;
import com.android.car.telephony.common.InMemoryPhoneBook;
@@ -29,6 +31,7 @@
@Override
public void onCreate() {
super.onCreate();
+ DialerServiceLocator.get().init(AndroidFrameworkImpl.get());
InMemoryPhoneBook.init(this);
UiCallManager.init(this);
UiBluetoothMonitor.init(this);
diff --git a/src/com/android/car/dialer/livedata/BluetoothErrorStringLiveData.java b/src/com/android/car/dialer/livedata/BluetoothErrorStringLiveData.java
index 0bb9da9..63fed99 100644
--- a/src/com/android/car/dialer/livedata/BluetoothErrorStringLiveData.java
+++ b/src/com/android/car/dialer/livedata/BluetoothErrorStringLiveData.java
@@ -16,7 +16,6 @@
package com.android.car.dialer.livedata;
-import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
@@ -26,6 +25,7 @@
import com.android.car.dialer.R;
import com.android.car.dialer.bluetooth.UiBluetoothMonitor;
import com.android.car.dialer.log.L;
+import com.android.car.dialer.servicelocator.DialerServiceLocator;
import java.util.Set;
@@ -56,7 +56,7 @@
private BluetoothErrorStringLiveData(Context context) {
mContext = context.getApplicationContext();
- if (BluetoothAdapter.getDefaultAdapter() == null) {
+ if (DialerServiceLocator.get().getAndroidFramework().getBluetoothAdapter() == null) {
setValue(mContext.getString(R.string.bluetooth_unavailable));
} else {
setValue(NO_BT_ERROR);
diff --git a/src/com/android/car/dialer/livedata/BluetoothHfpStateLiveData.java b/src/com/android/car/dialer/livedata/BluetoothHfpStateLiveData.java
index 4257d59..bb04eb2 100644
--- a/src/com/android/car/dialer/livedata/BluetoothHfpStateLiveData.java
+++ b/src/com/android/car/dialer/livedata/BluetoothHfpStateLiveData.java
@@ -24,10 +24,11 @@
import android.content.Intent;
import android.content.IntentFilter;
-import com.android.car.dialer.log.L;
-
import androidx.lifecycle.LiveData;
+import com.android.car.dialer.log.L;
+import com.android.car.dialer.servicelocator.DialerServiceLocator;
+
/**
* Provides the connectivity state of HFP Bluetooth profile. States can be one of:
* <ul>
@@ -40,7 +41,8 @@
public class BluetoothHfpStateLiveData extends LiveData<Integer> {
private static final String TAG = "CD.BluetoothHfpStateLiveData";
- private final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ private final BluetoothAdapter mBluetoothAdapter =
+ DialerServiceLocator.get().getBluetoothAdapter();
private final Context mContext;
private final IntentFilter mIntentFilter = new IntentFilter();
diff --git a/src/com/android/car/dialer/livedata/BluetoothPairListLiveData.java b/src/com/android/car/dialer/livedata/BluetoothPairListLiveData.java
index 94b7c3a..cd9d59d 100644
--- a/src/com/android/car/dialer/livedata/BluetoothPairListLiveData.java
+++ b/src/com/android/car/dialer/livedata/BluetoothPairListLiveData.java
@@ -27,6 +27,7 @@
import androidx.lifecycle.LiveData;
import com.android.car.dialer.log.L;
+import com.android.car.dialer.servicelocator.DialerServiceLocator;
import java.util.Set;
@@ -36,7 +37,8 @@
public class BluetoothPairListLiveData extends LiveData<Set<BluetoothDevice>> {
private static final String TAG = "CD.BluetoothPairListLiveData";
- private final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ private final BluetoothAdapter mBluetoothAdapter =
+ DialerServiceLocator.get().getBluetoothAdapter();
private final Context mContext;
private final IntentFilter mIntentFilter = new IntentFilter();
diff --git a/src/com/android/car/dialer/livedata/BluetoothStateLiveData.java b/src/com/android/car/dialer/livedata/BluetoothStateLiveData.java
index b8de0a1..f58ac3e 100644
--- a/src/com/android/car/dialer/livedata/BluetoothStateLiveData.java
+++ b/src/com/android/car/dialer/livedata/BluetoothStateLiveData.java
@@ -26,6 +26,7 @@
import androidx.lifecycle.LiveData;
import com.android.car.dialer.log.L;
+import com.android.car.dialer.servicelocator.DialerServiceLocator;
/**
* Provides the device Bluetooth availability. Updates client with {@link BluetoothState}.
@@ -47,7 +48,8 @@
int ENABLED = 2;
}
- private final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ private final BluetoothAdapter mBluetoothAdapter =
+ DialerServiceLocator.get().getBluetoothAdapter();
private final Context mContext;
private final IntentFilter mIntentFilter = new IntentFilter();
diff --git a/src/com/android/car/dialer/livedata/HfpDeviceListLiveData.java b/src/com/android/car/dialer/livedata/HfpDeviceListLiveData.java
index 54794d5..8d61c40 100644
--- a/src/com/android/car/dialer/livedata/HfpDeviceListLiveData.java
+++ b/src/com/android/car/dialer/livedata/HfpDeviceListLiveData.java
@@ -28,12 +28,15 @@
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
+import com.android.car.dialer.servicelocator.DialerServiceLocator;
+
import java.util.List;
/** {@link LiveData} that monitors the hfp connected devices. */
public class HfpDeviceListLiveData extends MutableLiveData<List<BluetoothDevice>> {
private final Context mContext;
- private final BluetoothAdapter mBluetoothAdapter;
+ private final BluetoothAdapter mBluetoothAdapter =
+ DialerServiceLocator.get().getBluetoothAdapter();
private final IntentFilter mIntentFilter;
private BluetoothHeadsetClient mBluetoothHeadsetClient;
@@ -49,7 +52,6 @@
public HfpDeviceListLiveData(Context context) {
mContext = context;
- mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter != null) {
mBluetoothAdapter.getProfileProxy(mContext, new BluetoothProfile.ServiceListener() {
@Override
diff --git a/src/com/android/car/dialer/servicelocator/DialerServiceLocator.java b/src/com/android/car/dialer/servicelocator/DialerServiceLocator.java
new file mode 100644
index 0000000..4b70f3f
--- /dev/null
+++ b/src/com/android/car/dialer/servicelocator/DialerServiceLocator.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.car.dialer.servicelocator;
+
+import android.bluetooth.BluetoothAdapter;
+
+import com.android.car.dialer.framework.AndroidFramework;
+
+/**
+ * Locates all kinds of services that Dialer app needs.
+ */
+public class DialerServiceLocator {
+ private static DialerServiceLocator sDialerServiceLocator = new DialerServiceLocator();
+
+ /**
+ * Returns the single instance of DialerServiceLocator.
+ */
+ public static DialerServiceLocator get() {
+ return sDialerServiceLocator;
+ }
+
+ private AndroidFramework mAndroidFramework;
+
+ /**
+ * A wrapper function which returns BluetoothAdapter provided by {@link AndroidFramework}.
+ */
+ public BluetoothAdapter getBluetoothAdapter() {
+ return mAndroidFramework.getBluetoothAdapter();
+ }
+
+ /**
+ * Returns the AndroidFramework.
+ */
+ public AndroidFramework getAndroidFramework() {
+ return mAndroidFramework;
+ }
+
+ /**
+ * Initials the service locator with all dependencies.
+ */
+ public void init(AndroidFramework androidFramework) {
+ mAndroidFramework = androidFramework;
+ }
+}
diff --git a/tests/instrutests/Android.bp b/tests/instrutests/Android.bp
index 1629cb0..36c2d60 100644
--- a/tests/instrutests/Android.bp
+++ b/tests/instrutests/Android.bp
@@ -1,6 +1,8 @@
//############################################################
-// Car Dialer Instrumented test target. #
+// Car Dialer Instrumented test target. #
//############################################################
+// Install CarDialerAppForTesting target before running this test.
+
android_test {
name: "CarDialerInstruTests",
@@ -10,7 +12,13 @@
static_libs: [
"androidx.test.ext.junit",
+ "androidx.test.ext.junit",
+ "androidx.test.runner",
+ "androidx.test.rules",
+ "mockito-target-extended",
],
+ jni_libs: ["libstaticjvmtiagent"],
+
instrumentation_for: "CarDialerAppForTesting",
}
diff --git a/tests/instrutests/AndroidManifest.xml b/tests/instrutests/AndroidManifest.xml
index 72c50a1..dd77f4b 100644
--- a/tests/instrutests/AndroidManifest.xml
+++ b/tests/instrutests/AndroidManifest.xml
@@ -16,7 +16,8 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.car.dialer.tests.instrutests">
+ package="com.android.car.dialer.tests.instrutests"
+ android:debuggable="true">
<application>
<uses-library android:name="android.test.runner" />
diff --git a/tests/instrutests/src/com/android/car/dialer/integration/RecentCallLogTest.java b/tests/instrutests/src/com/android/car/dialer/integration/RecentCallLogTest.java
new file mode 100644
index 0000000..a1d7186
--- /dev/null
+++ b/tests/instrutests/src/com/android/car/dialer/integration/RecentCallLogTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.car.dialer.integration;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.rule.ActivityTestRule;
+
+import com.android.car.dialer.framework.AndroidFrameworkImpl;
+import com.android.car.dialer.servicelocator.DialerServiceLocator;
+import com.android.car.dialer.ui.TelecomActivity;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class RecentCallLogTest {
+
+ @Rule
+ public final ActivityTestRule<TelecomActivity> mActivityTestRule =
+ new ActivityTestRule<TelecomActivity>(TelecomActivity.class) {
+ @Override
+ protected void afterActivityLaunched() {
+ super.afterActivityLaunched();
+ AndroidFrameworkImpl framework =
+ (AndroidFrameworkImpl) DialerServiceLocator.get().getAndroidFramework();
+ framework.connectBluetoothPhone();
+ }
+ };
+
+ @Test
+ public void verifyRecentCallScreen() {
+ // TODO implement the test.
+ }
+}