Use FragmentActivity instead of AppCompatActivity
Use FragmentActivity instead of AppCompatActivity
since AppCompatActivity doesn't support platform
level dramatic color change.
Bug: 216638097
Test: atest CtsCompanionDeviceManagerCoreTestCases
atest CtsCompanionDeviceManagerUiAutomationTestCases
atest CtsOsTestCases:CompanionDeviceManagerTest
Change-Id: I6d52bf37fa72c4266d1d1941325b6a63a8ab2643
diff --git a/packages/CompanionDeviceManager/res/color/selector.xml b/packages/CompanionDeviceManager/res/color/selector.xml
index fda827d..56e5dca 100644
--- a/packages/CompanionDeviceManager/res/color/selector.xml
+++ b/packages/CompanionDeviceManager/res/color/selector.xml
@@ -16,5 +16,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:color="@android:color/darker_gray"/> <!-- pressed -->
- <item android:color="@android:color/white"/>
+ <item android:color="?android:attr/colorBackground"/>
</selector>
\ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable/dialog_background.xml b/packages/CompanionDeviceManager/res/drawable/dialog_background.xml
index ef7052d..a017f41 100644
--- a/packages/CompanionDeviceManager/res/drawable/dialog_background.xml
+++ b/packages/CompanionDeviceManager/res/drawable/dialog_background.xml
@@ -16,7 +16,7 @@
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<shape android:shape="rectangle">
- <corners android:radius="@*android:dimen/config_dialogCornerRadius" />
+ <corners android:radius="?android:attr/dialogCornerRadius" />
<solid android:color="?android:attr/colorBackground" />
</shape>
</inset>
diff --git a/packages/CompanionDeviceManager/res/values/themes.xml b/packages/CompanionDeviceManager/res/values/themes.xml
index 8559ef6..7240432 100644
--- a/packages/CompanionDeviceManager/res/values/themes.xml
+++ b/packages/CompanionDeviceManager/res/values/themes.xml
@@ -17,9 +17,7 @@
<resources>
<style name="ChooserActivity"
- parent="@style/Theme.AppCompat.Light.Dialog">
- <item name="windowActionBar">false</item>
- <item name="windowNoTitle">true</item>
+ parent="@android:style/Theme.DeviceDefault.Light.Dialog">
<item name="*android:windowFixedHeightMajor">100%</item>
<item name="*android:windowFixedHeightMinor">100%</item>
<item name="android:windowBackground">@android:color/transparent</item>
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
index a6a8fcf..ae0c8cc 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
@@ -49,7 +49,7 @@
import android.widget.Button;
import android.widget.TextView;
-import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -59,7 +59,7 @@
* A CompanionDevice activity response for showing the available
* nearby devices to be associated with.
*/
-public class CompanionDeviceActivity extends AppCompatActivity {
+public class CompanionDeviceActivity extends FragmentActivity {
private static final boolean DEBUG = false;
private static final String TAG = CompanionDeviceActivity.class.getSimpleName();