summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2018-07-09 11:19:24 +0200
committerDanny Baumann <dannybaumann@web.de>2018-07-18 16:28:18 +0200
commitb9d2a3a9050919e31d828d7c03a289004fe6caef (patch)
treee546e24849fa019789bf78371a74a9aee06888a6 /java/com/android/dialer
parent863f51c4ef347e026a8cbf65b04a91665d65d3c8 (diff)
downloadandroid_packages_apps_Dialer-b9d2a3a9050919e31d828d7c03a289004fe6caef.tar.gz
android_packages_apps_Dialer-b9d2a3a9050919e31d828d7c03a289004fe6caef.tar.bz2
android_packages_apps_Dialer-b9d2a3a9050919e31d828d7c03a289004fe6caef.zip
Re-add call recording.
Change-Id: I53fadf5754b5b6cc3e9920d57480e470e2305ac0
Diffstat (limited to 'java/com/android/dialer')
-rw-r--r--java/com/android/dialer/app/res/values/cm_arrays.xml29
-rw-r--r--java/com/android/dialer/app/res/values/cm_strings.xml7
-rw-r--r--java/com/android/dialer/app/res/xml/file_paths.xml4
-rw-r--r--java/com/android/dialer/app/res/xml/sound_settings.xml14
-rw-r--r--java/com/android/dialer/app/settings/SoundSettingsFragment.java5
-rw-r--r--java/com/android/dialer/calldetails/CallDetailsActivity.java12
-rw-r--r--java/com/android/dialer/calldetails/CallDetailsAdapter.java7
-rw-r--r--java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java76
-rw-r--r--java/com/android/dialer/calldetails/res/drawable/recording_playback_button.xml26
-rw-r--r--java/com/android/dialer/calldetails/res/layout/call_details_entry.xml25
-rw-r--r--java/com/android/dialer/calldetails/res/values/cm_strings.xml23
-rw-r--r--java/com/android/dialer/callrecord/AndroidManifest.xml26
-rw-r--r--java/com/android/dialer/callrecord/CallRecording.aidl3
-rw-r--r--java/com/android/dialer/callrecord/CallRecording.java84
-rw-r--r--java/com/android/dialer/callrecord/CallRecordingDataStore.java177
-rw-r--r--java/com/android/dialer/callrecord/ICallRecorderService.aidl37
-rw-r--r--java/com/android/dialer/callrecord/impl/CallRecorderService.java238
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc202/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc204/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc206/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc208/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc214/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc216/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc218/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc219/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc222/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc226/config.xml24
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc230/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc231/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc232/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc234/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc235/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc238/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc240/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc242/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc244/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc246/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc247/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc248/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc260/config.xml22
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc262/config.xml20
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc268/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc270/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc272/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc278/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc280/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc284/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc293/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc310/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc362/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values-mcc505/config.xml19
-rw-r--r--java/com/android/dialer/callrecord/res/values/config.xml21
52 files changed, 1492 insertions, 7 deletions
diff --git a/java/com/android/dialer/app/res/values/cm_arrays.xml b/java/com/android/dialer/app/res/values/cm_arrays.xml
new file mode 100644
index 000000000..a788fd342
--- /dev/null
+++ b/java/com/android/dialer/app/res/values/cm_arrays.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013-2014 The CyanogenMod Project
+ Copyright (C) 2018 The LineageOS 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="call_recording_encoder_entries" translatable="false">
+ <item>@string/wb_amr_format</item>
+ <item>@string/aac_format</item>
+ </string-array>
+
+ <string-array name="call_recording_encoder_values" translatable="false">
+ <item>"0"</item>
+ <item>"1"</item>
+ </string-array>
+
+</resources>
diff --git a/java/com/android/dialer/app/res/values/cm_strings.xml b/java/com/android/dialer/app/res/values/cm_strings.xml
index 0ba0d500a..b28dcaeb2 100644
--- a/java/com/android/dialer/app/res/values/cm_strings.xml
+++ b/java/com/android/dialer/app/res/values/cm_strings.xml
@@ -31,4 +31,11 @@
<string name="incall_dnd_dialog_message">In order to enable Do Not Disturb, the Phone app needs to be granted the permission to control the Do Not Disturb status.\nPlease allow it.</string>
<string name="allow">Allow</string>
<string name="deny">Deny</string>
+
+ <string name="call_recording_category_key" translatable="false">call_recording_category</string>
+ <string name="call_recording_category_title">Call recording</string>
+ <string name="call_recording_format_key" translatable="false">call_recording_format</string>
+ <string name="call_recording_format">Audio format</string>
+ <string name="wb_amr_format" translatable="false">AMR-WB</string>
+ <string name="aac_format" translatable="false">AAC</string>
</resources>
diff --git a/java/com/android/dialer/app/res/xml/file_paths.xml b/java/com/android/dialer/app/res/xml/file_paths.xml
index 41522e4c8..a95bbc1f3 100644
--- a/java/com/android/dialer/app/res/xml/file_paths.xml
+++ b/java/com/android/dialer/app/res/xml/file_paths.xml
@@ -21,4 +21,8 @@
<files-path
name="voicemails"
path="voicemails/"/>
+ <!-- Offer access to saved call recordings -->
+ <external-path
+ name="recordings"
+ path="CallRecordings/"/>
</paths>
diff --git a/java/com/android/dialer/app/res/xml/sound_settings.xml b/java/com/android/dialer/app/res/xml/sound_settings.xml
index 4da5c1514..aa025874f 100644
--- a/java/com/android/dialer/app/res/xml/sound_settings.xml
+++ b/java/com/android/dialer/app/res/xml/sound_settings.xml
@@ -71,4 +71,18 @@
</PreferenceCategory>
+ <PreferenceCategory
+ android:key="@string/call_recording_category_key"
+ android:title="@string/call_recording_category_title">
+
+ <ListPreference
+ android:key="@string/call_recording_format_key"
+ android:title="@string/call_recording_format"
+ android:summary="%s"
+ android:entries="@array/call_recording_encoder_entries"
+ android:entryValues="@array/call_recording_encoder_values"
+ android:defaultValue="0" />
+
+ </PreferenceCategory>
+
</PreferenceScreen>
diff --git a/java/com/android/dialer/app/settings/SoundSettingsFragment.java b/java/com/android/dialer/app/settings/SoundSettingsFragment.java
index 11d470c44..a1aaea40e 100644
--- a/java/com/android/dialer/app/settings/SoundSettingsFragment.java
+++ b/java/com/android/dialer/app/settings/SoundSettingsFragment.java
@@ -37,6 +37,7 @@ import android.telephony.CarrierConfigManager;
import android.telephony.TelephonyManager;
import android.widget.Toast;
import com.android.dialer.app.R;
+import com.android.dialer.callrecord.impl.CallRecorderService;
import com.android.dialer.compat.SdkVersionOverride;
import com.android.dialer.util.SettingsUtil;
@@ -142,6 +143,10 @@ public class SoundSettingsFragment extends PreferenceFragment
getPreferenceScreen().removePreference(mDtmfToneLength);
mDtmfToneLength = null;
}
+ if (!CallRecorderService.isEnabled(getActivity())) {
+ getPreferenceScreen().removePreference(
+ findPreference(context.getString(R.string.call_recording_category_key)));
+ }
mNotificationManager = context.getSystemService(NotificationManager.class);
}
diff --git a/java/com/android/dialer/calldetails/CallDetailsActivity.java b/java/com/android/dialer/calldetails/CallDetailsActivity.java
index 411006c46..538540208 100644
--- a/java/com/android/dialer/calldetails/CallDetailsActivity.java
+++ b/java/com/android/dialer/calldetails/CallDetailsActivity.java
@@ -30,6 +30,7 @@ import android.support.v7.widget.Toolbar;
import android.support.v7.widget.Toolbar.OnMenuItemClickListener;
import android.view.MenuItem;
import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry;
+import com.android.dialer.callrecord.CallRecordingDataStore;
import com.android.dialer.common.Assert;
import com.android.dialer.common.concurrent.AsyncTaskExecutors;
import com.android.dialer.dialercontact.DialerContact;
@@ -54,6 +55,7 @@ public class CallDetailsActivity extends AppCompatActivity
private List<CallDetailsEntry> entries;
private DialerContact contact;
+ private CallRecordingDataStore callRecordingDataStore;
public static boolean isLaunchIntent(Intent intent) {
return intent.getComponent() != null
@@ -88,10 +90,17 @@ public class CallDetailsActivity extends AppCompatActivity
PerformanceReport.recordClick(UiAction.Type.CLOSE_CALL_DETAIL_WITH_CANCEL_BUTTON);
finish();
});
+ callRecordingDataStore = new CallRecordingDataStore();
onHandleIntent(getIntent());
}
@Override
+ protected void onDestroy() {
+ super.onDestroy();
+ callRecordingDataStore.close();
+ }
+
+ @Override
protected void onResume() {
super.onResume();
@@ -120,7 +129,8 @@ public class CallDetailsActivity extends AppCompatActivity
RecyclerView recyclerView = findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
- recyclerView.setAdapter(new CallDetailsAdapter(this, contact, entries, this));
+ recyclerView.setAdapter(new CallDetailsAdapter(this,
+ contact, entries, this, callRecordingDataStore));
PerformanceReport.logOnScrollStateChange(recyclerView);
}
diff --git a/java/com/android/dialer/calldetails/CallDetailsAdapter.java b/java/com/android/dialer/calldetails/CallDetailsAdapter.java
index 48e9b6998..c94989794 100644
--- a/java/com/android/dialer/calldetails/CallDetailsAdapter.java
+++ b/java/com/android/dialer/calldetails/CallDetailsAdapter.java
@@ -24,6 +24,7 @@ import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry;
import com.android.dialer.calllogutils.CallTypeHelper;
+import com.android.dialer.callrecord.CallRecordingDataStore;
import com.android.dialer.common.Assert;
import com.android.dialer.dialercontact.DialerContact;
import java.util.List;
@@ -39,15 +40,18 @@ final class CallDetailsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
private final List<CallDetailsEntry> callDetailsEntries;
private final CallDetailsFooterViewHolder.ReportCallIdListener listener;
private final CallTypeHelper callTypeHelper;
+ private final CallRecordingDataStore callRecordingDataStore;
CallDetailsAdapter(
Context context,
@NonNull DialerContact contact,
@NonNull List<CallDetailsEntry> callDetailsEntries,
- CallDetailsFooterViewHolder.ReportCallIdListener listener) {
+ CallDetailsFooterViewHolder.ReportCallIdListener listener,
+ CallRecordingDataStore callRecordingDataStore) {
this.contact = Assert.isNotNull(contact);
this.callDetailsEntries = callDetailsEntries;
this.listener = listener;
+ this.callRecordingDataStore = callRecordingDataStore;
callTypeHelper = new CallTypeHelper(context.getResources());
}
@@ -83,6 +87,7 @@ final class CallDetailsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
contact.getNumber(),
entry,
callTypeHelper,
+ callRecordingDataStore,
!entry.getHistoryResultsList().isEmpty() && position != getItemCount() - 2);
}
}
diff --git a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java
index 204e40721..9109a3efd 100644
--- a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java
+++ b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java
@@ -16,28 +16,45 @@
package com.android.dialer.calldetails;
+import android.content.ActivityNotFoundException;
import android.content.Context;
+import android.content.Intent;
import android.net.Uri;
import android.provider.CallLog.Calls;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
+import android.support.v4.content.FileProvider;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.text.TextUtils;
+import android.text.format.DateFormat;
+import android.view.Menu;
import android.view.View;
+import android.webkit.MimeTypeMap;
import android.widget.ImageView;
+import android.widget.PopupMenu;
import android.widget.TextView;
+import android.widget.Toast;
import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry;
import com.android.dialer.calllogutils.CallEntryFormatter;
import com.android.dialer.calllogutils.CallTypeHelper;
import com.android.dialer.calllogutils.CallTypeIconsView;
+import com.android.dialer.callrecord.CallRecording;
+import com.android.dialer.callrecord.CallRecordingDataStore;
+import com.android.dialer.callrecord.impl.CallRecorderService;
import com.android.dialer.common.LogUtil;
import com.android.dialer.compat.AppCompatConstants;
+import com.android.dialer.constants.Constants;
import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult;
import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult.Type;
import com.android.dialer.oem.MotorolaUtils;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.IntentUtil;
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
/** ViewHolder for call entries in {@link CallDetailsActivity}. */
public class CallDetailsEntryViewHolder extends ViewHolder {
@@ -55,6 +72,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
private final TextView postCallNote;
private final ImageView multimediaImage;
+ private final TextView playbackButton;
// TODO: Display this when location is stored - b/36160042
@SuppressWarnings("unused")
@@ -71,6 +89,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
callTime = (TextView) container.findViewById(R.id.call_time);
callDuration = (TextView) container.findViewById(R.id.call_duration);
+ playbackButton = (TextView) container.findViewById(R.id.play_recordings);
multimediaImageContainer = container.findViewById(R.id.multimedia_image_container);
multimediaDetailsContainer = container.findViewById(R.id.ec_container);
multimediaDivider = container.findViewById(R.id.divider);
@@ -85,6 +104,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
String number,
CallDetailsEntry entry,
CallTypeHelper callTypeHelper,
+ CallRecordingDataStore callRecordingDataStore,
boolean showMultimediaDivider) {
int callType = entry.getCallType();
boolean isVideoCall = (entry.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO;
@@ -113,6 +133,22 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
CallEntryFormatter.formatDurationAndDataUsageA11y(
context, entry.getDuration(), entry.getDataUsage()));
}
+
+ // do this synchronously to prevent recordings from "popping in" after detail item is displayed
+ final List<CallRecording> recordings;
+ if (CallRecorderService.isEnabled(context)) {
+ callRecordingDataStore.open(context); // opens unless already open
+ recordings = callRecordingDataStore.getRecordings(number, entry.getDate());
+ } else {
+ recordings = null;
+ }
+
+ int count = recordings != null ? recordings.size() : 0;
+ playbackButton.setOnClickListener(v -> handleRecordingClick(v, recordings));
+ playbackButton.setText(
+ context.getResources().getQuantityString(R.plurals.play_recordings, count, count));
+ playbackButton.setVisibility(count > 0 ? View.VISIBLE : View.GONE);
+
setMultimediaDetails(number, entry, showMultimediaDivider);
}
@@ -164,6 +200,46 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
DialerUtils.startActivityWithErrorToast(context, IntentUtil.getSendSmsIntent(number));
}
+ private void handleRecordingClick(View v, List<CallRecording> recordings) {
+ final Context context = v.getContext();
+ if (recordings.size() == 1) {
+ playRecording(context, recordings.get(0));
+ } else {
+ PopupMenu menu = new PopupMenu(context, v);
+ String pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(),
+ DateFormat.is24HourFormat(context) ? "Hmss" : "hmssa");
+ SimpleDateFormat format = new SimpleDateFormat(pattern);
+
+ for (int i = 0; i < recordings.size(); i++) {
+ final long startTime = recordings.get(i).startRecordingTime;
+ final String formattedDate = format.format(new Date(startTime));
+ menu.getMenu().add(Menu.NONE, i, i, formattedDate);
+ }
+ menu.setOnMenuItemClickListener(item -> {
+ playRecording(context, recordings.get(item.getItemId()));
+ return true;
+ });
+ menu.show();
+ }
+ }
+
+ private void playRecording(Context context, CallRecording recording) {
+ Uri uri = FileProvider.getUriForFile(context,
+ Constants.get().getFileProviderAuthority(), recording.getFile());
+ String extension = MimeTypeMap.getFileExtensionFromUrl(uri.toString());
+ String mime = !TextUtils.isEmpty(extension)
+ ? MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension) : "audio/*";
+ try {
+ Intent intent = new Intent(Intent.ACTION_VIEW)
+ .setDataAndType(uri, mime)
+ .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+ context.startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ Toast.makeText(context, R.string.call_playback_no_app_found_toast, Toast.LENGTH_LONG)
+ .show();
+ }
+ }
+
private static boolean isIncoming(@NonNull HistoryResult historyResult) {
return historyResult.getType() == Type.INCOMING_POST_CALL
|| historyResult.getType() == Type.INCOMING_CALL_COMPOSER;
diff --git a/java/com/android/dialer/calldetails/res/drawable/recording_playback_button.xml b/java/com/android/dialer/calldetails/res/drawable/recording_playback_button.xml
new file mode 100644
index 000000000..c3f637fee
--- /dev/null
+++ b/java/com/android/dialer/calldetails/res/drawable/recording_playback_button.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The CyanogenMod 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+
+ <path
+ android:fillColor="@color/call_log_icon_tint"
+ android:pathData="M 21,30.75 L 30,24 21,17.25 21,30.75 Z M 24,9 C 15.7125,9 9,15.7125 9,24 9,32.2875 15.7125,39 24,39 32.2875,39 39,32.2875 39,24 39,15.7125 32.2875,9 24,9 Z m 0,27 c -6.615,0 -12,-5.385 -12,-12 0,-6.615 5.385,-12 12,-12 6.615,0 12,5.385 12,12 0,6.615 -5.385,12 -12,12 z" />
+</vector>
+
diff --git a/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml b/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml
index 3d4750d09..015d8fad6 100644
--- a/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml
+++ b/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml
@@ -19,7 +19,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="@dimen/call_entry_padding">
+ android:paddingTop="@dimen/call_entry_padding"
+ android:paddingBottom="@dimen/call_entry_bottom_padding">
<com.android.dialer.calllogutils.CallTypeIconsView
android:id="@+id/call_direction"
@@ -45,7 +46,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/call_entry_text_left_margin"
android:layout_below="@+id/call_type"
- android:layout_marginBottom="@dimen/call_entry_bottom_padding"
style="@style/SecondaryText"/>
<TextView
@@ -56,12 +56,27 @@
android:layout_marginEnd="@dimen/call_entry_padding"
style="@style/PrimaryText"/>
+ <TextView
+ android:id="@+id/play_recordings"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/call_time"
+ android:paddingStart="@dimen/call_entry_text_left_margin"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:gravity="center_vertical"
+ android:drawableStart="@drawable/recording_playback_button"
+ android:drawablePadding="4dp"
+ android:background="?attr/selectableItemBackground"
+ android:visibility="gone"
+ style="@style/SecondaryText"/>
+
<include
layout="@layout/ec_data_container"
android:id="@+id/ec_container"
android:layout_height="@dimen/ec_container_height"
android:layout_width="match_parent"
- android:layout_below="@+id/call_time"
+ android:layout_below="@id/play_recordings"
android:visibility="gone"/>
<TextView
@@ -80,10 +95,10 @@
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
- android:layout_below="@id/post_call_note"
+ android:layout_below="@id/play_recordings"
android:layout_marginTop="@dimen/ec_divider_top_bottom_margin"
android:layout_marginBottom="@dimen/ec_divider_top_bottom_margin"
android:layout_marginStart="@dimen/call_entry_text_left_margin"
android:background="#12000000"
android:visibility="gone"/>
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/java/com/android/dialer/calldetails/res/values/cm_strings.xml b/java/com/android/dialer/calldetails/res/values/cm_strings.xml
new file mode 100644
index 000000000..076a49479
--- /dev/null
+++ b/java/com/android/dialer/calldetails/res/values/cm_strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013-2014 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <plurals name="play_recordings">
+ <item quantity="one">Play recording</item>
+ <item quantity="other">Play recordings</item>
+ </plurals>
+ <string name="call_playback_no_app_found_toast">No app could be found for playback of the selected recording.</string>
+</resources>
diff --git a/java/com/android/dialer/callrecord/AndroidManifest.xml b/java/com/android/dialer/callrecord/AndroidManifest.xml
new file mode 100644
index 000000000..5e25c7351
--- /dev/null
+++ b/java/com/android/dialer/callrecord/AndroidManifest.xml
@@ -0,0 +1,26 @@
+<!-- Copyright (C) 2018 The LineageOS 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.dialer">
+
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
+ <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />
+
+ <application>
+ <service android:name="com.android.dialer.callrecord.impl.CallRecorderService"
+ android:process="com.android.incallui" />
+ </application>
+</manifest>
diff --git a/java/com/android/dialer/callrecord/CallRecording.aidl b/java/com/android/dialer/callrecord/CallRecording.aidl
new file mode 100644
index 000000000..e8d65bef2
--- /dev/null
+++ b/java/com/android/dialer/callrecord/CallRecording.aidl
@@ -0,0 +1,3 @@
+package com.android.dialer.callrecord;
+
+parcelable CallRecording;
diff --git a/java/com/android/dialer/callrecord/CallRecording.java b/java/com/android/dialer/callrecord/CallRecording.java
new file mode 100644
index 000000000..9fd77b46e
--- /dev/null
+++ b/java/com/android/dialer/callrecord/CallRecording.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod 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.dialer.callrecord;
+
+import android.os.Environment;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.io.File;
+
+public final class CallRecording implements Parcelable {
+ public String phoneNumber;
+ public long creationTime;
+ public String fileName;
+ public long startRecordingTime;
+
+ private static final String PUBLIC_DIRECTORY_NAME = "CallRecordings";
+
+ public static final Parcelable.Creator<CallRecording> CREATOR =
+ new Parcelable.Creator<CallRecording>() {
+ @Override
+ public CallRecording createFromParcel(Parcel in) {
+ return new CallRecording(in);
+ }
+
+ @Override
+ public CallRecording[] newArray(int size) {
+ return new CallRecording[size];
+ }
+ };
+
+ public CallRecording(String phoneNumber, long creationTime,
+ String fileName, long startRecordingTime) {
+ this.phoneNumber = phoneNumber;
+ this.creationTime = creationTime;
+ this.fileName = fileName;
+ this.startRecordingTime = startRecordingTime;
+ }
+
+ public CallRecording(Parcel in) {
+ phoneNumber = in.readString();
+ creationTime = in.readLong();
+ fileName = in.readString();
+ startRecordingTime = in.readLong();
+ }
+
+ public File getFile() {
+ File dir = Environment.getExternalStoragePublicDirectory(PUBLIC_DIRECTORY_NAME);
+ return new File(dir, fileName);
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(phoneNumber);
+ out.writeLong(creationTime);
+ out.writeString(fileName);
+ out.writeLong(startRecordingTime);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public String toString() {
+ return "phoneNumber=" + phoneNumber + ", creationTime=" + creationTime +
+ ", fileName=" + fileName + ", startRecordingTime=" + startRecordingTime;
+ }
+}
diff --git a/java/com/android/dialer/callrecord/CallRecordingDataStore.java b/java/com/android/dialer/callrecord/CallRecordingDataStore.java
new file mode 100644
index 000000000..59020ff3a
--- /dev/null
+++ b/java/com/android/dialer/callrecord/CallRecordingDataStore.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod 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.dialer.callrecord;
+
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteException;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.database.sqlite.SQLiteStatement;
+import android.provider.BaseColumns;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Persistent data store for call recordings. Usage:
+ * open()
+ * read/write operations
+ * close()
+ */
+public class CallRecordingDataStore {
+ private static final String TAG = "CallRecordingStore";
+ private SQLiteOpenHelper mOpenHelper = null;
+ private SQLiteDatabase mDatabase = null;
+
+ /**
+ * Open before reading/writing. Will not open handle if one is already open.
+ */
+ public void open(Context context) {
+ if (mDatabase == null) {
+ mOpenHelper = new CallRecordingSQLiteOpenHelper(context);
+ mDatabase = mOpenHelper.getWritableDatabase();
+ }
+ }
+
+ /**
+ * close when finished reading/writing
+ */
+ public void close() {
+ if (mDatabase != null) {
+ mDatabase.close();
+ }
+ if (mOpenHelper != null) {
+ mOpenHelper.close();
+ }
+ mDatabase = null;
+ mOpenHelper = null;
+ }
+
+ /**
+ * Save a recording in the data store
+ *
+ * @param recording the recording to store
+ */
+ public void putRecording(CallRecording recording) {
+ final String insertSql = "INSERT INTO " +
+ CallRecordingsContract.CallRecording.TABLE_NAME + " (" +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_PHONE_NUMBER + ", " +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_CALL_DATE + ", " +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_RECORDING_FILENAME + ", " +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_CREATION_DATE + ") " +
+ " VALUES (?, ?, ?, ?)";
+
+ try {
+ SQLiteStatement stmt = mDatabase.compileStatement(insertSql);
+ int idx = 1;
+ stmt.bindString(idx++, recording.phoneNumber);
+ stmt.bindLong(idx++, recording.creationTime);
+ stmt.bindString(idx++, recording.fileName);
+ stmt.bindLong(idx++, System.currentTimeMillis());
+ long id = stmt.executeInsert();
+ Log.i(TAG, "Saved recording " + recording + " with id " + id);
+ } catch (SQLiteException e) {
+ Log.w(TAG, "Failed to save recording " + recording, e);
+ }
+ }
+
+ /**
+ * Get all recordings associated with a phone call
+ *
+ * @param phoneNumber phone number no spaces
+ * @param callCreationDate time that the call was created
+ * @return list of recordings
+ */
+ public List<CallRecording> getRecordings(String phoneNumber, long callCreationDate) {
+ List<CallRecording> resultList = new ArrayList<CallRecording>();
+
+ final String query = "SELECT " +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_RECORDING_FILENAME + "," +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_CREATION_DATE +
+ " FROM " + CallRecordingsContract.CallRecording.TABLE_NAME +
+ " WHERE " + CallRecordingsContract.CallRecording.COLUMN_NAME_PHONE_NUMBER + " = ?" +
+ " AND " + CallRecordingsContract.CallRecording.COLUMN_NAME_CALL_DATE + " = ?" +
+ " ORDER BY " + CallRecordingsContract.CallRecording.COLUMN_NAME_CREATION_DATE;
+
+ String args[] = {
+ phoneNumber, String.valueOf(callCreationDate)
+ };
+
+ try {
+ Cursor cursor = mDatabase.rawQuery(query, args);
+ while (cursor.moveToNext()) {
+ String fileName = cursor.getString(0);
+ long creationDate = cursor.getLong(1);
+ CallRecording recording =
+ new CallRecording(phoneNumber, callCreationDate, fileName, creationDate);
+ if (recording.getFile().exists()) {
+ resultList.add(recording);
+ }
+ }
+ cursor.close();
+ } catch (SQLiteException e) {
+ Log.w(TAG, "Failed to fetch recordings for number " + phoneNumber +
+ ", date " + callCreationDate, e);
+ }
+
+ return resultList;
+ }
+
+ static class CallRecordingsContract {
+ static interface CallRecording extends BaseColumns {
+ static final String TABLE_NAME = "call_recordings";
+ static final String COLUMN_NAME_PHONE_NUMBER = "phone_number";
+ static final String COLUMN_NAME_CALL_DATE = "call_date";
+ static final String COLUMN_NAME_RECORDING_FILENAME = "recording_filename";
+ static final String COLUMN_NAME_CREATION_DATE = "creation_date";
+ }
+ }
+
+ static class CallRecordingSQLiteOpenHelper extends SQLiteOpenHelper {
+ private static final int VERSION = 1;
+ private static final String DB_NAME = "callrecordings.db";
+
+ public CallRecordingSQLiteOpenHelper(Context context) {
+ super(context, DB_NAME, null, VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL("CREATE TABLE " + CallRecordingsContract.CallRecording.TABLE_NAME + " (" +
+ CallRecordingsContract.CallRecording._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_PHONE_NUMBER + " TEXT," +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_CALL_DATE + " LONG," +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_RECORDING_FILENAME + " TEXT, " +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_CREATION_DATE + " LONG" +
+ ");"
+ );
+
+ db.execSQL("CREATE INDEX IF NOT EXISTS phone_number_call_date_index ON " +
+ CallRecordingsContract.CallRecording.TABLE_NAME + " (" +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_PHONE_NUMBER + ", " +
+ CallRecordingsContract.CallRecording.COLUMN_NAME_CALL_DATE + ");"
+ );
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ // implement if we change the schema
+ }
+ }
+}
diff --git a/java/com/android/dialer/callrecord/ICallRecorderService.aidl b/java/com/android/dialer/callrecord/ICallRecorderService.aidl
new file mode 100644
index 000000000..acbd5f8bb
--- /dev/null
+++ b/java/com/android/dialer/callrecord/ICallRecorderService.aidl
@@ -0,0 +1,37 @@
+package com.android.dialer.callrecord;
+
+import com.android.dialer.callrecord.CallRecording;
+
+/**
+ * Service for recording phone calls. Only one recording may be active at a time
+ * (i.e. every call to startRecording should be followed by a call to stopRecording).
+ */
+interface ICallRecorderService {
+ /**
+ * Start a recording.
+ *
+ * @return true if recording started successfully
+ */
+ boolean startRecording(String phoneNumber, long creationTime);
+
+ /**
+ * stops the current recording
+ *
+ * @return call recording data including the output filename
+ */
+ CallRecording stopRecording();
+
+ /**
+ * Recording status
+ *
+ * @return true if there is an active recording
+ */
+ boolean isRecording();
+
+ /**
+ * Get recording currently in progress
+ *
+ * @return call recording object
+ */
+ CallRecording getActiveRecording();
+}
diff --git a/java/com/android/dialer/callrecord/impl/CallRecorderService.java b/java/com/android/dialer/callrecord/impl/CallRecorderService.java
new file mode 100644
index 000000000..32d552617
--- /dev/null
+++ b/java/com/android/dialer/callrecord/impl/CallRecorderService.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod 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.dialer.callrecord.impl;
+
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.media.MediaRecorder;
+import android.media.MediaScannerConnection;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.SystemProperties;
+import android.text.TextUtils;
+import android.provider.Settings;
+import android.util.Log;
+
+import com.android.dialer.callrecord.CallRecording;
+import com.android.dialer.callrecord.ICallRecorderService;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.android.dialer.R;
+
+public class CallRecorderService extends Service {
+ private static final String TAG = "CallRecorderService";
+ private static final boolean DBG = false;
+
+ private static enum RecorderState {
+ IDLE,
+ RECORDING
+ };
+
+ private MediaRecorder mMediaRecorder = null;
+ private RecorderState mState = RecorderState.IDLE;
+ private CallRecording mCurrentRecording = null;
+
+ private static final String AUDIO_SOURCE_PROPERTY = "persist.call_recording.src";
+
+ private SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyMMdd_HHmmssSSS");
+
+ private final ICallRecorderService.Stub mBinder = new ICallRecorderService.Stub() {
+ @Override
+ public CallRecording stopRecording() {
+ if (getState() == RecorderState.RECORDING) {
+ stopRecordingInternal();
+ return mCurrentRecording;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean startRecording(String phoneNumber, long creationTime) throws RemoteException {
+ String fileName = generateFilename(phoneNumber);
+ mCurrentRecording = new CallRecording(phoneNumber, creationTime,
+ fileName, System.currentTimeMillis());
+ return startRecordingInternal(mCurrentRecording.getFile());
+ }
+
+ @Override
+ public boolean isRecording() throws RemoteException {
+ return getState() == RecorderState.RECORDING;
+ }
+
+ @Override
+ public CallRecording getActiveRecording() throws RemoteException {
+ return mCurrentRecording;
+ }
+ };
+
+ @Override
+ public void onCreate() {
+ if (DBG) Log.d(TAG, "Creating CallRecorderService");
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return mBinder;
+ }
+
+ private int getAudioSource() {
+ int defaultValue = getResources().getInteger(R.integer.call_recording_audio_source);
+ return SystemProperties.getInt(AUDIO_SOURCE_PROPERTY, defaultValue);
+ }
+
+ private int getAudioFormatChoice() {
+ // This replicates PreferenceManager.getDefaultSharedPreferences, except
+ // that we need multi process preferences, as the pref is written in a separate
+ // process (com.android.dialer vs. com.android.incallui)
+ final String prefName = getPackageName() + "_preferences";
+ final SharedPreferences prefs = getSharedPreferences(prefName, MODE_MULTI_PROCESS);
+
+ try {
+ String value = prefs.getString(getString(R.string.call_recording_format_key), null);
+ if (value != null) {
+ return Integer.parseInt(value);
+ }
+ } catch (NumberFormatException e) {
+ // ignore and fall through
+ }
+ return 0;
+ }
+
+ private synchronized boolean startRecordingInternal(File file) {
+ if (mMediaRecorder != null) {
+ if (DBG) {
+ Log.d(TAG, "Start called with recording in progress, stopping current recording");
+ }
+ stopRecordingInternal();
+ }
+
+ if (checkSelfPermission(android.Manifest.permission.RECORD_AUDIO)
+ != PackageManager.PERMISSION_GRANTED) {
+ Log.w(TAG, "Record audio permission not granted, can't record call");
+ return false;
+ }
+ if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
+ != PackageManager.PERMISSION_GRANTED) {
+ Log.w(TAG, "External storage permission not granted, can't save recorded call");
+ return false;
+ }
+
+ if (DBG) Log.d(TAG, "Starting recording");
+
+ mMediaRecorder = new MediaRecorder();
+ try {
+ int audioSource = getAudioSource();
+ int formatChoice = getAudioFormatChoice();
+ if (DBG) Log.d(TAG, "Creating media recorder with audio source " + audioSource);
+ mMediaRecorder.setAudioSource(audioSource);
+ mMediaRecorder.setOutputFormat(formatChoice == 0
+ ? MediaRecorder.OutputFormat.AMR_WB : MediaRecorder.OutputFormat.MPEG_4);
+ mMediaRecorder.setAudioEncoder(formatChoice == 0
+ ? MediaRecorder.AudioEncoder.AMR_WB : MediaRecorder.AudioEncoder.AAC);
+ } catch (IllegalStateException e) {
+ Log.w(TAG, "Error initializing media recorder", e);
+ return false;
+ }
+
+ file.getParentFile().mkdirs();
+ String outputPath = file.getAbsolutePath();
+ if (DBG) Log.d(TAG, "Writing output to file " + outputPath);
+
+ try {
+ mMediaRecorder.setOutputFile(outputPath);
+ mMediaRecorder.prepare();
+ mMediaRecorder.start();
+ mState = RecorderState.RECORDING;
+ return true;
+ } catch (IOException e) {
+ Log.w(TAG, "Could not start recording for file " + outputPath, e);
+ Log.w(TAG, "Deleting failed recording " + outputPath);
+ file.delete();
+ } catch (IllegalStateException e) {
+ Log.w(TAG, "Could not start recording for file " + outputPath, e);
+ Log.w(TAG, "Deleting failed recording " + outputPath);
+ file.delete();
+ } catch (RuntimeException e) {
+ // only catch exceptions thrown by the MediaRecorder JNI code
+ if (e.getMessage().indexOf("start failed") >= 0) {
+ Log.w(TAG, "Could not start recording for file " + outputPath, e);
+ Log.w(TAG, "Deleting failed recording " + outputPath);
+ file.delete();
+ } else {
+ throw e;
+ }
+ }
+
+ mMediaRecorder.reset();
+ mMediaRecorder.release();
+ mMediaRecorder = null;
+
+ return false;
+ }
+
+ private synchronized void stopRecordingInternal() {
+ if (DBG) Log.d(TAG, "Stopping current recording");
+ if (mMediaRecorder != null) {
+ try {
+ if (getState() == RecorderState.RECORDING) {
+ mMediaRecorder.stop();
+ mMediaRecorder.reset();
+ mMediaRecorder.release();
+ }
+ } catch (IllegalStateException e) {
+ Log.e(TAG, "Exception closing media recorder", e);
+ }
+ MediaScannerConnection.scanFile(this,
+ new String[] { mCurrentRecording.fileName }, null, null);
+ mMediaRecorder = null;
+ mState = RecorderState.IDLE;
+ }
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (DBG) Log.d(TAG, "Destroying CallRecorderService");
+ }
+
+ private synchronized RecorderState getState() {
+ return mState;
+ }
+
+ private String generateFilename(String number) {
+ String timestamp = DATE_FORMAT.format(new Date());
+
+ if (TextUtils.isEmpty(number)) {
+ number = "unknown";
+ }
+
+ int formatChoice = getAudioFormatChoice();
+ String extension = formatChoice == 0 ? ".amr" : ".m4a";
+ return number + "_" + timestamp + extension;
+ }
+
+ public static boolean isEnabled(Context context) {
+ return context.getResources().getBoolean(R.bool.call_recording_enabled);
+ }
+}
diff --git a/java/com/android/dialer/callrecord/res/values-mcc202/config.xml b/java/com/android/dialer/callrecord/res/values-mcc202/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc202/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc204/config.xml b/java/com/android/dialer/callrecord/res/values-mcc204/config.xml
new file mode 100644
index 000000000..9fbbd5489
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc204/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Netherlands-->
+<!--Legal precedent source: http://blog.wetrecht.nl/telefoongesprekken-opnemen-als-bewijs-kan-dat/ -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc206/config.xml b/java/com/android/dialer/callrecord/res/values-mcc206/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc206/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc208/config.xml b/java/com/android/dialer/callrecord/res/values-mcc208/config.xml
new file mode 100644
index 000000000..2474f5db4
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc208/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: France-->
+<!--Legal precedent source: http://levesquelavoie.com/2011/11/la-legalite-de-lenregistrement-dune-conversation/-->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc214/config.xml b/java/com/android/dialer/callrecord/res/values-mcc214/config.xml
new file mode 100644
index 000000000..efc7c14ed
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc214/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Spain-->
+<!--Legal precedent source: http://www.legalisconsultores.es/2014/04/es-legal-realizar-grabacionesse-pueden-aportar-como-prueba-en-juicios/ -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc216/config.xml b/java/com/android/dialer/callrecord/res/values-mcc216/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc216/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc218/config.xml b/java/com/android/dialer/callrecord/res/values-mcc218/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc218/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc219/config.xml b/java/com/android/dialer/callrecord/res/values-mcc219/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc219/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc222/config.xml b/java/com/android/dialer/callrecord/res/values-mcc222/config.xml
new file mode 100644
index 000000000..6087b8b6c
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc222/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Italy-->
+<!--Legal precedent source: http://www.altalex.com/index.php?idnot=53369 -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc226/config.xml b/java/com/android/dialer/callrecord/res/values-mcc226/config.xml
new file mode 100644
index 000000000..216906da7
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc226/config.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Romania-->
+<!--Legal precedent source: http://www.dsclex.ro/coduri/cciv2.htm
+ http://www.dreptonline.ro/legislatie/codul_procedura_civila_consolidat.php
+ http://www.dreptonline.ro/legislatie/codul_procedura_penala_2007.php -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc230/config.xml b/java/com/android/dialer/callrecord/res/values-mcc230/config.xml
new file mode 100644
index 000000000..d6169db88
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc230/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Czech Republic-->
+<!--Legal precedent source: http://nalus.usoud.cz/Search/GetText.aspx?sz=1-191-05_2 -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc231/config.xml b/java/com/android/dialer/callrecord/res/values-mcc231/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc231/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc232/config.xml b/java/com/android/dialer/callrecord/res/values-mcc232/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc232/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc234/config.xml b/java/com/android/dialer/callrecord/res/values-mcc234/config.xml
new file mode 100644
index 000000000..84ea1e46b
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc234/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: United Kingdom-->
+<!--Legal precedent source: http://www.ofcom.org.uk/static/archive/oftel/consumer/advice/faqs/prvfaq3.htm -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc235/config.xml b/java/com/android/dialer/callrecord/res/values-mcc235/config.xml
new file mode 100644
index 000000000..705c71768
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc235/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: United Kingdom-->
+<!--Legal precedent source: http://www.ofcom.org.uk/static/archive/oftel/consumer/advice/faqs/prvfaq3.htm -->
+<resources>
+
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/callrecord/res/values-mcc238/config.xml b/java/com/android/dialer/callrecord/res/values-mcc238/config.xml
new file mode 100644
index 000000000..e745c17f3
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc238/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Denmark-->
+<!--Legal precedent source: https://www.retsinformation.dk/Forms/r0710.aspx?id=164192#Kap27 -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc240/config.xml b/java/com/android/dialer/callrecord/res/values-mcc240/config.xml
new file mode 100644
index 000000000..8f75521d5
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc240/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Sweden-->
+<!--Legal precedent source: https://lagen.nu/begrepp/Olovlig_avlyssning -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc242/config.xml b/java/com/android/dialer/callrecord/res/values-mcc242/config.xml
new file mode 100644
index 000000000..4cd0818df
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc242/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Norway-->
+<!--Legal precedent source: https://www.datatilsynet.no/verktoy-skjema/Veiledere/Lydopptak-/ -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc244/config.xml b/java/com/android/dialer/callrecord/res/values-mcc244/config.xml
new file mode 100644
index 000000000..4eba15bc2
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc244/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Finland-->
+<!--Legal precedent source: http://www.tietosuoja.fi/fi/index/ratkaisut/puheluidennauhoittaminen.html -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc246/config.xml b/java/com/android/dialer/callrecord/res/values-mcc246/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc246/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc247/config.xml b/java/com/android/dialer/callrecord/res/values-mcc247/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc247/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc248/config.xml b/java/com/android/dialer/callrecord/res/values-mcc248/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc248/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc260/config.xml b/java/com/android/dialer/callrecord/res/values-mcc260/config.xml
new file mode 100644
index 000000000..c2876e020
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc260/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<!--Allow recording for country: Poland-->
+<!--Legal precedent source: http://www.giodo.gov.pl/data/filemanager_pl/467.doc -->
+<resources>
+
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc262/config.xml b/java/com/android/dialer/callrecord/res/values-mcc262/config.xml
new file mode 100644
index 000000000..0fffd2aec
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc262/config.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc268/config.xml b/java/com/android/dialer/callrecord/res/values-mcc268/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc268/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc270/config.xml b/java/com/android/dialer/callrecord/res/values-mcc270/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc270/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc272/config.xml b/java/com/android/dialer/callrecord/res/values-mcc272/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc272/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc278/config.xml b/java/com/android/dialer/callrecord/res/values-mcc278/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc278/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc280/config.xml b/java/com/android/dialer/callrecord/res/values-mcc280/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc280/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc284/config.xml b/java/com/android/dialer/callrecord/res/values-mcc284/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc284/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc293/config.xml b/java/com/android/dialer/callrecord/res/values-mcc293/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc293/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc310/config.xml b/java/com/android/dialer/callrecord/res/values-mcc310/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc310/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc362/config.xml b/java/com/android/dialer/callrecord/res/values-mcc362/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc362/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values-mcc505/config.xml b/java/com/android/dialer/callrecord/res/values-mcc505/config.xml
new file mode 100644
index 000000000..def954f23
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values-mcc505/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod 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.
+-->
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+</resources>
diff --git a/java/com/android/dialer/callrecord/res/values/config.xml b/java/com/android/dialer/callrecord/res/values/config.xml
new file mode 100644
index 000000000..311a7a1fa
--- /dev/null
+++ b/java/com/android/dialer/callrecord/res/values/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+
+<resources>
+ <bool name="call_recording_enabled">false</bool>
+ <integer name="call_recording_audio_source">1</integer>
+</resources>