Use separate AndroidManifest.xml for testing build

Debuggable flag needs to be true for testing build.

Fixes: 188978110
Test: atest CarDialerUnitTests
Change-Id: I2c32cc3a5b3a4288ad1d19b6de14bf5fc1d50ac8
diff --git a/Android.bp b/Android.bp
index 0cdb553..5aab50a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -101,6 +101,12 @@
 
     sdk_version: "system_current",
 
+    required: ["allowed_privapp_com.android.car.dialer"],
+
+    certificate: "platform",
+
+    overrides: ["Dialer"],
+
     libs: common_libs,
 
     static_libs: [
@@ -156,6 +162,8 @@
 
     required: ["allowed_privapp_com.android.car.dialer"],
 
+    certificate: "platform",
+
     overrides: ["Dialer"],
 
     libs: common_libs,
diff --git a/framework/Android.bp b/framework/Android.bp
index 1fddb4d..a0c4482 100644
--- a/framework/Android.bp
+++ b/framework/Android.bp
@@ -26,6 +26,8 @@
     // required to access any private API.
     sdk_version: "system_current",
 
+    manifest: "real/AndroidManifest.xml",
+
     srcs: ["src/**/*.java", "real/src/**/*.java"],
 
     static_libs: [
@@ -43,6 +45,8 @@
     // required to access any private API and spy() on any framework class.
     sdk_version: "system_current",
 
+    manifest: "fake/AndroidManifest.xml",
+
     srcs: ["src/**/*.java", "fake/src/**/*.java"],
 
     asset_dirs: [
diff --git a/framework/AndroidManifest.xml b/framework/fake/AndroidManifest.xml
similarity index 90%
rename from framework/AndroidManifest.xml
rename to framework/fake/AndroidManifest.xml
index a342974..290e284 100644
--- a/framework/AndroidManifest.xml
+++ b/framework/fake/AndroidManifest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-  ~ Copyright (C) 2020 The Android Open Source Project
+  ~ Copyright (C) 2021 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.
@@ -22,4 +22,6 @@
     <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
     <uses-permission android:name="android.permission.READ_CONTACTS"/>
 
-</manifest>
\ No newline at end of file
+    <application android:debuggable="true"/>
+
+</manifest>
diff --git a/framework/AndroidManifest.xml b/framework/real/AndroidManifest.xml
similarity index 80%
copy from framework/AndroidManifest.xml
copy to framework/real/AndroidManifest.xml
index a342974..daf14d9 100644
--- a/framework/AndroidManifest.xml
+++ b/framework/real/AndroidManifest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-  ~ Copyright (C) 2020 The Android Open Source Project
+  ~ Copyright (C) 2021 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.
@@ -19,7 +19,4 @@
           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"/>
-
-</manifest>
\ No newline at end of file
+</manifest>