DivestOS/Patches/LineageOS-18.1/android_packages_apps_Dialer/0001-Not_Private_Banner.patch
Tad 898c040ead More useless churn
Signed-off-by: Tad <tad@spotco.us>
2021-11-01 21:04:59 -04:00

186 lines
8.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Torsten Grote <t@grobox.de>
Date: Thu, 18 Jun 2020 13:15:16 -0300
Subject: [PATCH] Show privacy warning on in-call screen
Includes:
Author: Chirayu Desai <chirayudesai1@gmail.com>
Date: Tue Jul 28 02:23:37 2020 +0530
Move the incall warning back to the center
* Instead of left/started aligned.
Change-Id: Ic9b18c110481df7042ca1daa36182e0999fe948f
---
.../res/drawable/ic_baseline_warning.xml | 9 +++++
.../dialer/theme/common/res/values/colors.xml | 1 +
.../res/layout/fragment_incoming_call.xml | 7 +++-
.../contactgrid/res/layout/incall_header.xml | 39 +++++++++++++++++++
.../impl/res/layout/frag_incall_voice.xml | 7 ++++
.../android/incallui/res/values/strings.xml | 3 ++
.../incallui/theme/res/values/styles.xml | 4 +-
7 files changed, 67 insertions(+), 3 deletions(-)
create mode 100644 java/com/android/dialer/common/res/drawable/ic_baseline_warning.xml
create mode 100644 java/com/android/incallui/contactgrid/res/layout/incall_header.xml
diff --git a/java/com/android/dialer/common/res/drawable/ic_baseline_warning.xml b/java/com/android/dialer/common/res/drawable/ic_baseline_warning.xml
new file mode 100644
index 000000000..c2baa9bdb
--- /dev/null
+++ b/java/com/android/dialer/common/res/drawable/ic_baseline_warning.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="16dp"
+ android:width="16dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path android:fillColor="?attr/colorControlNormal"
+ android:pathData="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"/>
+</vector>
\ No newline at end of file
diff --git a/java/com/android/dialer/theme/common/res/values/colors.xml b/java/com/android/dialer/theme/common/res/values/colors.xml
index 1831862b1..6f6795cea 100644
--- a/java/com/android/dialer/theme/common/res/values/colors.xml
+++ b/java/com/android/dialer/theme/common/res/values/colors.xml
@@ -21,6 +21,7 @@
<color name="dialer_divider_line_color">#D8D8D8</color>
<color name="dialer_link_color">#2A56C6</color>
<color name="dialer_snackbar_action_text_color">#4285F4</color>
+ <color name="incall_header_background">#f3b514</color>
<!-- Colors for the notification actions -->
<color name="notification_action_accept">#097138</color>
diff --git a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml
index 1672bf984..63de75999 100644
--- a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml
+++ b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml
@@ -78,18 +78,23 @@
android:id="@+id/incall_contact_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginTop="24dp"
android:clipChildren="false"
android:clipToPadding="false"
android:focusable="true"
android:gravity="top|center_horizontal"
android:orientation="vertical">
+ <include
+ layout="@layout/incall_header"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
<include
android:id="@id/contactgrid_top_row"
layout="@layout/incall_contactgrid_top_row"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="24dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"/>
diff --git a/java/com/android/incallui/contactgrid/res/layout/incall_header.xml b/java/com/android/incallui/contactgrid/res/layout/incall_header.xml
new file mode 100644
index 000000000..7e8e90e5d
--- /dev/null
+++ b/java/com/android/incallui/contactgrid/res/layout/incall_header.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 The Calyx Institute
+ ~
+ ~ 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
+ -->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/incall_header_background"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:padding="8dp"
+ android:fitsSystemWindows="true">
+
+ <TextView
+ android:id="@+id/incall_privacy_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:attr/textColorPrimaryInverse"
+ android:drawableStart="@drawable/ic_baseline_warning"
+ android:drawablePadding="8dp"
+ android:drawableTint="?android:attr/textColorPrimaryInverse"
+ android:gravity="center"
+ android:padding="4dp"
+ android:text="@string/incall_screen_privacy_data_collection"/>
+
+</LinearLayout>
diff --git a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml
index 9cc599dc7..fac420908 100644
--- a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml
+++ b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml
@@ -29,11 +29,18 @@
android:clipToPadding="false"
android:fitsSystemWindows="true">
+ <include
+ layout="@layout/incall_header"
+ android:id="@+id/incall_header"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
<LinearLayout
android:id="@id/incall_contact_grid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
+ android:layout_below="@+id/incall_header"
android:gravity="center_horizontal"
android:orientation="vertical">
diff --git a/java/com/android/incallui/res/values/strings.xml b/java/com/android/incallui/res/values/strings.xml
index c18ee495e..a5d08d3ec 100644
--- a/java/com/android/incallui/res/values/strings.xml
+++ b/java/com/android/incallui/res/values/strings.xml
@@ -212,4 +212,7 @@
<!-- Text for button to accept RTT request. [CHAR LIMIT=20] -->
<string name="rtt_button_accept_request">Join RTT</string>
+ <!-- Text for call not private banner. -->
+ <string name="incall_screen_privacy_data_collection">The location and audio of this call are not private.</string>
+
</resources>
diff --git a/java/com/android/incallui/theme/res/values/styles.xml b/java/com/android/incallui/theme/res/values/styles.xml
index 5b65cc3d9..19e7fdc4f 100644
--- a/java/com/android/incallui/theme/res/values/styles.xml
+++ b/java/com/android/incallui/theme/res/values/styles.xml
@@ -21,7 +21,7 @@
Theme.Black.NoTitleBar directly, since we want any popups or dialogs from the
InCallActivity to have the correct Material style. -->
<style name="Theme.InCallScreen.Light" parent="@style/Dialer.ThemeBase.NoActionBar">
- <item name="android:statusBarColor">@android:color/transparent</item>
+ <item name="android:statusBarColor">@color/incall_header_background</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
@@ -36,7 +36,7 @@
<style name="Theme.InCallScreen" parent="@style/Dialer.Dark.ThemeBase.NoActionBar">
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColorSecondary">#DDFFFFFF</item>
- <item name="android:statusBarColor">@android:color/transparent</item>
+ <item name="android:statusBarColor">@color/incall_header_background</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item>