summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/postcall
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-08-31 06:57:16 -0700
committerRoland Levillain <rpl@google.com>2017-09-04 18:05:19 +0100
commitfc0eb8ccebcc7846db5e8b5c5430070055679bfa (patch)
treea8a23c3202e4161ffd57a71095a404db1bcf5735 /java/com/android/dialer/postcall
parentea7b4dc89590ffa3332766a531e0eab6ffb9aebd (diff)
Update Dialer source to latest internal Google revision.
Previously, Android's Dialer app was developed in an internal Google source control system and only exported to public during AOSP drops. The Dialer team is now switching to a public development model similar to the telephony team. This CL represents all internal Google changes that were committed to Dialer between the public O release and today's tip of tree on internal master. This CL squashes those changes into a single commit. In subsequent changes, changes will be exported on a per-commit basis. (cherry picked from commit 2ca4318cc1ee57dda907ba2069bd61d162b1baef and amended to match paths of dependencies under prebuilts/maven_repo/bumptech/com/github/bumptech/glide/.) This CL was generated using these commands from a repository at stage-stage-master at revision ea7b4dc89590ffa3332766a531e0eab6ffb9aebd ("Merge "Update Dialer source to latest internal Google revision." am: c39ea3c55f -s ours"): git diff --binary 2ca4318cc1ee57dda907ba2069bd61d162b1baef | git apply -R --index git commit -c 2ca4318cc1ee57dda907ba2069bd61d162b1baef Test: make, flash install, run Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8 PiperOrigin-RevId: 167068436
Diffstat (limited to 'java/com/android/dialer/postcall')
-rw-r--r--java/com/android/dialer/postcall/AndroidManifest.xml5
-rw-r--r--java/com/android/dialer/postcall/PostCall.java16
-rw-r--r--java/com/android/dialer/postcall/res/layout/post_call_activity.xml23
3 files changed, 28 insertions, 16 deletions
diff --git a/java/com/android/dialer/postcall/AndroidManifest.xml b/java/com/android/dialer/postcall/AndroidManifest.xml
index 22c77dd93..a09750564 100644
--- a/java/com/android/dialer/postcall/AndroidManifest.xml
+++ b/java/com/android/dialer/postcall/AndroidManifest.xml
@@ -15,14 +15,13 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.dialer.callcomposer">
+ package="com.android.dialer.postcall">
<application android:theme="@style/Theme.AppCompat">
<activity
android:name="com.android.dialer.postcall.PostCallActivity"
android:exported="false"
android:theme="@style/DialerThemeBase.NoActionBar"
- android:windowSoftInputMode="adjustResize"
- android:screenOrientation="portrait"/>
+ android:windowSoftInputMode="adjustResize"/>
</application>
</manifest>
diff --git a/java/com/android/dialer/postcall/PostCall.java b/java/com/android/dialer/postcall/PostCall.java
index 6d9ad01a8..011fbc985 100644
--- a/java/com/android/dialer/postcall/PostCall.java
+++ b/java/com/android/dialer/postcall/PostCall.java
@@ -46,6 +46,7 @@ public class PostCall {
private static final String KEY_POST_CALL_CALL_CONNECT_TIME = "post_call_call_connect_time";
private static final String KEY_POST_CALL_CALL_NUMBER = "post_call_call_number";
private static final String KEY_POST_CALL_MESSAGE_SENT = "post_call_message_sent";
+ private static final String KEY_POST_CALL_DISCONNECT_PRESSED = "post_call_disconnect_pressed";
private static Snackbar activeSnackbar;
@@ -79,7 +80,7 @@ public class PostCall {
LogUtil.sanitizePhoneNumber(getPhoneNumber(activity)),
capabilities);
- boolean isRcsPostCall = capabilities != null && capabilities.supportsPostCall();
+ boolean isRcsPostCall = capabilities != null && capabilities.isPostCallCapable();
String actionText =
isRcsPostCall
? activity.getString(R.string.post_call_add_message)
@@ -146,6 +147,13 @@ public class PostCall {
.apply();
}
+ public static void onDisconnectPressed(Context context) {
+ DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
+ .edit()
+ .putBoolean(KEY_POST_CALL_DISCONNECT_PRESSED, true)
+ .apply();
+ }
+
public static void onCallDisconnected(Context context, String number, long callConnectedMillis) {
DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
.edit()
@@ -185,6 +193,7 @@ public class PostCall {
.remove(KEY_POST_CALL_CALL_NUMBER)
.remove(KEY_POST_CALL_MESSAGE_SENT)
.remove(KEY_POST_CALL_CALL_CONNECT_TIME)
+ .remove(KEY_POST_CALL_DISCONNECT_PRESSED)
.apply();
}
@@ -197,6 +206,8 @@ public class PostCall {
long timeSinceDisconnect = System.currentTimeMillis() - disconnectTimeMillis;
long callDurationMillis = disconnectTimeMillis - connectTimeMillis;
+ boolean callDisconnectedByUser = manager.getBoolean(KEY_POST_CALL_DISCONNECT_PRESSED, false);
+
ConfigProvider binding = ConfigProviderBindings.get(context);
return disconnectTimeMillis != -1
&& connectTimeMillis != -1
@@ -204,7 +215,8 @@ public class PostCall {
&& binding.getLong("postcall_last_call_threshold", 30_000) > timeSinceDisconnect
&& (connectTimeMillis == 0
|| binding.getLong("postcall_call_duration_threshold", 35_000) > callDurationMillis)
- && getPhoneNumber(context) != null;
+ && getPhoneNumber(context) != null
+ && callDisconnectedByUser;
}
private static boolean shouldPromptUserToViewSentMessage(Context context) {
diff --git a/java/com/android/dialer/postcall/res/layout/post_call_activity.xml b/java/com/android/dialer/postcall/res/layout/post_call_activity.xml
index 256c110b9..c42764e5b 100644
--- a/java/com/android/dialer/postcall/res/layout/post_call_activity.xml
+++ b/java/com/android/dialer/postcall/res/layout/post_call_activity.xml
@@ -14,20 +14,21 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:background="@color/background_dialer_white"
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <FrameLayout
- android:id="@+id/message_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:background="@color/background_dialer_white"/>
+ android:layout_height="match_parent"
+ android:background="@color/background_dialer_white">
<com.android.dialer.widget.DialerToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
-</RelativeLayout> \ No newline at end of file
+
+ <FrameLayout
+ android:id="@+id/message_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/background_dialer_white"/>
+</LinearLayout> \ No newline at end of file