diff options
Diffstat (limited to 'java/com/android/dialer/constants')
6 files changed, 155 insertions, 0 deletions
diff --git a/java/com/android/dialer/constants/ActivityRequestCodes.java b/java/com/android/dialer/constants/ActivityRequestCodes.java new file mode 100644 index 000000000..da05eb76b --- /dev/null +++ b/java/com/android/dialer/constants/ActivityRequestCodes.java @@ -0,0 +1,41 @@ +/* + * 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.constants; + +/** + * Class containing {@link android.app.Activity#onActivityResult(int, int, android.content.Intent)} + * request codes. + */ +public final class ActivityRequestCodes { + + private ActivityRequestCodes() {} + + /** Request code for {@link android.speech.RecognizerIntent#ACTION_RECOGNIZE_SPEECH} intent. */ + public static final int DIALTACTS_VOICE_SEARCH = 1; + + /** Request code for {@link com.android.dialer.callcomposer.CallComposerActivity} intent. */ + public static final int DIALTACTS_CALL_COMPOSER = 2; + + /** + * Request code for {@link + * com.android.dialer.lightbringer.Lightbringer#getIntent(android.content.Context, String)}. + */ + public static final int DIALTACTS_LIGHTBRINGER = 3; + + /** Request code for {@link com.android.dialer.calldetails.CallDetailsActivity} intent. */ + public static final int DIALTACTS_CALL_DETAILS = 4; +} diff --git a/java/com/android/dialer/constants/Constants.java b/java/com/android/dialer/constants/Constants.java index d92c0bcfc..f9d07e31d 100644 --- a/java/com/android/dialer/constants/Constants.java +++ b/java/com/android/dialer/constants/Constants.java @@ -16,6 +16,7 @@ package com.android.dialer.constants; +import android.content.Context; import android.support.annotation.NonNull; import com.android.dialer.common.Assert; import com.android.dialer.proguard.UsedByReflection; @@ -53,5 +54,10 @@ public abstract class Constants { @NonNull public abstract String getFileProviderAuthority(); + @NonNull + public abstract String getAnnotatedCallLogProviderAuthority(); + + public abstract String getUserAgent(Context context); + protected Constants() {} } diff --git a/java/com/android/dialer/constants/ScheduledJobIds.java b/java/com/android/dialer/constants/ScheduledJobIds.java index 2fed4ef8a..cf93a464a 100644 --- a/java/com/android/dialer/constants/ScheduledJobIds.java +++ b/java/com/android/dialer/constants/ScheduledJobIds.java @@ -32,6 +32,8 @@ public final class ScheduledJobIds { public static final int VVM_TASK_SCHEDULER_JOB = 200; public static final int VVM_STATUS_CHECK_JOB = 201; public static final int VVM_DEVICE_PROVISIONED_JOB = 202; + public static final int VVM_TRANSCRIPTION_JOB = 203; + public static final int VVM_TRANSCRIPTION_BACKFILL_JOB = 204; public static final int VOIP_REGISTRATION = 300; diff --git a/java/com/android/dialer/constants/TrafficStatsTags.java b/java/com/android/dialer/constants/TrafficStatsTags.java new file mode 100644 index 000000000..1eca7840a --- /dev/null +++ b/java/com/android/dialer/constants/TrafficStatsTags.java @@ -0,0 +1,33 @@ +/* + * 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.constants; + +/** Registry of tags for {@link android.net.TrafficStats#setThreadStatsTag(int)} */ +public class TrafficStatsTags { + public static final int CONTACT_PHOTO_DOWNLOAD_TAG = 0x00000001; + public static final int NEARBY_PLACES_TAG = 0x00000002; + public static final int REVERSE_LOOKUP_CONTACT_TAG = 0x00000003; + public static final int REVERSE_LOOKUP_IMAGE_TAG = 0x00000004; + public static final int DOWNLOAD_LOCATION_MAP_TAG = 0x00000005; + public static final int REVERSE_GEOCODE_TAG = 0x00000006; + public static final int VISUAL_VOICEMAIL_TAG = 0x00000007; + + // 0xfffffe00 to 0xffffff00 reserved for proprietary extensions to the dialer app. + + // 0xffffff00 to 0xffffffff reserved by the system (see TrafficStats#getAndSetThreadStatsTag) + +} diff --git a/java/com/android/dialer/constants/aospdialer/ConstantsImpl.java b/java/com/android/dialer/constants/aospdialer/ConstantsImpl.java index 6b78b986c..38fd24b8a 100644 --- a/java/com/android/dialer/constants/aospdialer/ConstantsImpl.java +++ b/java/com/android/dialer/constants/aospdialer/ConstantsImpl.java @@ -16,6 +16,7 @@ package com.android.dialer.constants; +import android.content.Context; import android.support.annotation.NonNull; import com.android.dialer.proguard.UsedByReflection; @@ -34,4 +35,15 @@ public class ConstantsImpl extends Constants { public String getFileProviderAuthority() { return "com.android.dialer.files"; } + + @NonNull + @Override + public String getAnnotatedCallLogProviderAuthority() { + return "com.android.dialer.annotatedcalllog"; + } + + @Override + public String getUserAgent(Context context) { + return null; + } } diff --git a/java/com/android/dialer/constants/googledialer/ConstantsImpl.java b/java/com/android/dialer/constants/googledialer/ConstantsImpl.java new file mode 100644 index 000000000..e151344ba --- /dev/null +++ b/java/com/android/dialer/constants/googledialer/ConstantsImpl.java @@ -0,0 +1,61 @@ +/* + * 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.constants; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.os.Build; +import android.support.annotation.NonNull; +import com.android.dialer.proguard.UsedByReflection; + +/** Provider config values for Google Dialer. */ +@UsedByReflection(value = "Constants.java") +public class ConstantsImpl extends Constants { + + @Override + @NonNull + public String getFilteredNumberProviderAuthority() { + return "com.google.android.dialer.blocking.filterednumberprovider"; + } + + @Override + @NonNull + public String getFileProviderAuthority() { + return "com.google.android.dialer.files"; + } + + @NonNull + @Override + public String getAnnotatedCallLogProviderAuthority() { + return "com.google.android.dialer.annotatedcalllog"; + } + + @Override + public String getUserAgent(Context context) { + StringBuilder userAgent = new StringBuilder("GoogleDialer "); + try { + String versionName = + context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; + userAgent.append(versionName).append(" "); + } catch (PackageManager.NameNotFoundException e) { + // ignore + } + userAgent.append(Build.FINGERPRINT); + + return userAgent.toString(); + } +} |