From d5e47f6da5b08b13ecdfa7f1edc7e12aeb83fab9 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Wed, 15 Mar 2017 14:41:07 -0700 Subject: Update Dialer source from latest green build. * Refactor voicemail component * Add new enriched calling components Test: treehugger, manual aosp testing Change-Id: I521a0f86327d4b42e14d93927c7d613044ed5942 --- .../android/dialer/binary/aosp/AndroidManifest.xml | 116 +++++++++++++++++++++ .../dialer/binary/aosp/AospDialerApplication.java | 30 ++++++ .../binary/aosp/AospDialerRootComponent.java | 30 ++++++ .../basecomponent/BaseDialerRootComponent.java | 34 ++++++ .../dialer/binary/common/DialerApplication.java | 43 ++++++++ 5 files changed, 253 insertions(+) create mode 100644 java/com/android/dialer/binary/aosp/AndroidManifest.xml create mode 100644 java/com/android/dialer/binary/aosp/AospDialerApplication.java create mode 100644 java/com/android/dialer/binary/aosp/AospDialerRootComponent.java create mode 100644 java/com/android/dialer/binary/basecomponent/BaseDialerRootComponent.java create mode 100644 java/com/android/dialer/binary/common/DialerApplication.java (limited to 'java/com/android/dialer/binary') diff --git a/java/com/android/dialer/binary/aosp/AndroidManifest.xml b/java/com/android/dialer/binary/aosp/AndroidManifest.xml new file mode 100644 index 000000000..63edb8397 --- /dev/null +++ b/java/com/android/dialer/binary/aosp/AndroidManifest.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/binary/aosp/AospDialerApplication.java b/java/com/android/dialer/binary/aosp/AospDialerApplication.java new file mode 100644 index 000000000..f657a3987 --- /dev/null +++ b/java/com/android/dialer/binary/aosp/AospDialerApplication.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.binary.aosp; + +import android.support.annotation.NonNull; +import com.android.dialer.binary.common.DialerApplication; +import com.android.dialer.inject.ContextModule; + +/** + * The application class for the AOSP Dialer. This is a version of the Dialer app that has no + * dependency on Google Play Services. + */ +public class AospDialerApplication extends DialerApplication { + + +} diff --git a/java/com/android/dialer/binary/aosp/AospDialerRootComponent.java b/java/com/android/dialer/binary/aosp/AospDialerRootComponent.java new file mode 100644 index 000000000..8628e90c2 --- /dev/null +++ b/java/com/android/dialer/binary/aosp/AospDialerRootComponent.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.binary.aosp; + +import com.android.dialer.binary.basecomponent.BaseDialerRootComponent; +import com.android.dialer.enrichedcall.stub.StubEnrichedCallModule; +import com.android.dialer.inject.ContextModule; +import com.android.dialer.simulator.impl.SimulatorModule; +import com.android.incallui.calllocation.stub.StubCallLocationModule; +import com.android.incallui.maps.stub.StubMapsModule; +import com.android.voicemail.impl.VoicemailModule; +import dagger.Component; +import javax.inject.Singleton; + +/** Root component for the AOSP Dialer application. */ +public interface AospDialerRootComponent extends BaseDialerRootComponent {} diff --git a/java/com/android/dialer/binary/basecomponent/BaseDialerRootComponent.java b/java/com/android/dialer/binary/basecomponent/BaseDialerRootComponent.java new file mode 100644 index 000000000..907671b01 --- /dev/null +++ b/java/com/android/dialer/binary/basecomponent/BaseDialerRootComponent.java @@ -0,0 +1,34 @@ +/* + * 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.binary.basecomponent; + +import com.android.dialer.enrichedcall.EnrichedCallComponent; +import com.android.dialer.simulator.SimulatorComponent; +import com.android.incallui.calllocation.CallLocationComponent; +import com.android.incallui.maps.MapsComponent; +import com.android.voicemail.VoicemailComponent; + +/** + * Base class for the core application-wide {@link Component}. All variants of the Dialer app should + * extend from this component. + */ +public interface BaseDialerRootComponent + extends CallLocationComponent.HasComponent, + EnrichedCallComponent.HasComponent, + MapsComponent.HasComponent, + SimulatorComponent.HasComponent, + VoicemailComponent.HasComponent {} diff --git a/java/com/android/dialer/binary/common/DialerApplication.java b/java/com/android/dialer/binary/common/DialerApplication.java new file mode 100644 index 000000000..c0be4328c --- /dev/null +++ b/java/com/android/dialer/binary/common/DialerApplication.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2013 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.binary.common; + +import android.app.Application; +import android.os.Trace; +import android.preference.PreferenceManager; +import android.support.annotation.NonNull; +import com.android.dialer.blocking.BlockedNumbersAutoMigrator; +import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; + +/** A common application subclass for all Dialer build variants. */ +public abstract class DialerApplication extends Application { + + private volatile Object rootComponent; + + @Override + public void onCreate() { + Trace.beginSection("DialerApplication.onCreate"); + super.onCreate(); + new BlockedNumbersAutoMigrator( + this, + PreferenceManager.getDefaultSharedPreferences(this), + new FilteredNumberAsyncQueryHandler(this)) + .autoMigrate(); + Trace.endSection(); + } + +} -- cgit v1.2.3