From 2d6bc36921c4a41b17bc1870c133ee42f1388b51 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Mon, 19 Jun 2017 17:28:33 -0700 Subject: Add "Simulator" for Enriched Calling An annoying part of development on enriched calling is that it was difficult to determine what sessions were in memory. We have a number of bugs related to incorrect sessions being shown, and knowing exactly what sessions are available in memory can help debug them. This CL adds a "Simulator" for enriched calling. This is more of a debug tool than a simulator since it doesn't yet support adding a new enriched calling session. To allow the simulator to view all of the sessions in memory, a new EnrichedCallManager API was introduced: getAllSessionsView. This API was designed in a way to prevent abuse, so it returns a list of string representations of the sessions. Just returning the full list of sessions would have allowed clients to bypass the getSession logic and examine sessions that shouldn't be available. Also in this change: * Integrate changes to form a base for future copybara imports. Test: TH PiperOrigin-RevId: 159445010 Change-Id: Ie8fc35d817a4e3b0eac37e0c34a6592060c43b23 --- .../buildtype/bugfood/BuildTypeAccessorImpl.java | 30 ++++++++++++++++++++++ .../buildtype/dogfood/BuildTypeAccessorImpl.java | 30 ++++++++++++++++++++++ .../buildtype/fishfood/BuildTypeAccessorImpl.java | 30 ++++++++++++++++++++++ .../buildtype/test/BuildTypeAccessorImpl.java | 30 ++++++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 java/com/android/dialer/buildtype/bugfood/BuildTypeAccessorImpl.java create mode 100644 java/com/android/dialer/buildtype/dogfood/BuildTypeAccessorImpl.java create mode 100644 java/com/android/dialer/buildtype/fishfood/BuildTypeAccessorImpl.java create mode 100644 java/com/android/dialer/buildtype/test/BuildTypeAccessorImpl.java (limited to 'java/com/android/dialer/buildtype') diff --git a/java/com/android/dialer/buildtype/bugfood/BuildTypeAccessorImpl.java b/java/com/android/dialer/buildtype/bugfood/BuildTypeAccessorImpl.java new file mode 100644 index 000000000..45d72e05c --- /dev/null +++ b/java/com/android/dialer/buildtype/bugfood/BuildTypeAccessorImpl.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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.buildtype; + +import com.android.dialer.proguard.UsedByReflection; + +/** Gets the build type. */ +@UsedByReflection(value = "BuildType.java") +public class BuildTypeAccessorImpl implements BuildTypeAccessor { + + @Override + @BuildType.Type + public int getBuildType() { + return BuildType.BUGFOOD; + } +} diff --git a/java/com/android/dialer/buildtype/dogfood/BuildTypeAccessorImpl.java b/java/com/android/dialer/buildtype/dogfood/BuildTypeAccessorImpl.java new file mode 100644 index 000000000..e1f2cdc79 --- /dev/null +++ b/java/com/android/dialer/buildtype/dogfood/BuildTypeAccessorImpl.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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.buildtype; + +import com.android.dialer.proguard.UsedByReflection; + +/** Gets the build type. */ +@UsedByReflection(value = "BuildType.java") +public class BuildTypeAccessorImpl implements BuildTypeAccessor { + + @Override + @BuildType.Type + public int getBuildType() { + return BuildType.DOGFOOD; + } +} diff --git a/java/com/android/dialer/buildtype/fishfood/BuildTypeAccessorImpl.java b/java/com/android/dialer/buildtype/fishfood/BuildTypeAccessorImpl.java new file mode 100644 index 000000000..e5ad9015f --- /dev/null +++ b/java/com/android/dialer/buildtype/fishfood/BuildTypeAccessorImpl.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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.buildtype; + +import com.android.dialer.proguard.UsedByReflection; + +/** Gets the build type. */ +@UsedByReflection(value = "BuildType.java") +public class BuildTypeAccessorImpl implements BuildTypeAccessor { + + @Override + @BuildType.Type + public int getBuildType() { + return BuildType.FISHFOOD; + } +} diff --git a/java/com/android/dialer/buildtype/test/BuildTypeAccessorImpl.java b/java/com/android/dialer/buildtype/test/BuildTypeAccessorImpl.java new file mode 100644 index 000000000..80a1cb728 --- /dev/null +++ b/java/com/android/dialer/buildtype/test/BuildTypeAccessorImpl.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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.buildtype; + +import com.android.dialer.proguard.UsedByReflection; + +/** Gets the build type. */ +@UsedByReflection(value = "BuildType.java") +public class BuildTypeAccessorImpl implements BuildTypeAccessor { + + @Override + @BuildType.Type + public int getBuildType() { + return BuildType.TEST; + } +} -- cgit v1.2.3