Loading java/com/android/dialer/binary/aosp/AospDialerRootComponent.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.dialer.strictmode.impl.SystemStrictModeModule; import com.android.incallui.calllocation.stub.StubCallLocationModule; import com.android.incallui.calllocation.stub.StubCallLocationModule; import com.android.incallui.maps.stub.StubMapsModule; import com.android.incallui.maps.stub.StubMapsModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.newbubble.stub.StubNewBubbleModule; import com.android.voicemail.impl.VoicemailModule; import com.android.voicemail.impl.VoicemailModule; import dagger.Component; import dagger.Component; import javax.inject.Singleton; import javax.inject.Singleton; Loading @@ -59,6 +60,7 @@ import javax.inject.Singleton; StubCallLocationModule.class, StubCallLocationModule.class, StubDuoModule.class, StubDuoModule.class, StubEnrichedCallModule.class, StubEnrichedCallModule.class, StubNewBubbleModule.class, StubFeedbackModule.class, StubFeedbackModule.class, StubMapsModule.class, StubMapsModule.class, StubSimSuggestionModule.class, StubSimSuggestionModule.class, Loading java/com/android/dialer/binary/basecomponent/BaseDialerRootComponent.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.dialer.strictmode.StrictModeComponent; import com.android.incallui.calllocation.CallLocationComponent; import com.android.incallui.calllocation.CallLocationComponent; import com.android.incallui.maps.MapsComponent; import com.android.incallui.maps.MapsComponent; import com.android.incallui.speakeasy.SpeakEasyComponent; import com.android.incallui.speakeasy.SpeakEasyComponent; import com.android.newbubble.NewBubbleComponent; import com.android.voicemail.VoicemailComponent; import com.android.voicemail.VoicemailComponent; /** /** Loading @@ -56,6 +57,7 @@ public interface BaseDialerRootComponent FeedbackComponent.HasComponent, FeedbackComponent.HasComponent, MainComponent.HasComponent, MainComponent.HasComponent, MapsComponent.HasComponent, MapsComponent.HasComponent, NewBubbleComponent.HasComponent, PhoneLookupComponent.HasComponent, PhoneLookupComponent.HasComponent, PhoneNumberGeoUtilComponent.HasComponent, PhoneNumberGeoUtilComponent.HasComponent, PreCallComponent.HasComponent, PreCallComponent.HasComponent, Loading java/com/android/dialer/binary/google/GoogleStubDialerRootComponent.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.dialer.strictmode.impl.SystemStrictModeModule; import com.android.incallui.calllocation.impl.CallLocationModule; import com.android.incallui.calllocation.impl.CallLocationModule; import com.android.incallui.maps.impl.MapsModule; import com.android.incallui.maps.impl.MapsModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.newbubble.stub.StubNewBubbleModule; import com.android.voicemail.impl.VoicemailModule; import com.android.voicemail.impl.VoicemailModule; import dagger.Component; import dagger.Component; import javax.inject.Singleton; import javax.inject.Singleton; Loading Loading @@ -64,6 +65,7 @@ import javax.inject.Singleton; StubDuoModule.class, StubDuoModule.class, StubEnrichedCallModule.class, StubEnrichedCallModule.class, StubFeedbackModule.class, StubFeedbackModule.class, StubNewBubbleModule.class, StubSimSuggestionModule.class, StubSimSuggestionModule.class, StubSpamModule.class, StubSpamModule.class, StubSpeakEasyModule.class, StubSpeakEasyModule.class, Loading java/com/android/incallui/NewReturnToCallController.java +25 −2 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.content.Intent; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.graphics.drawable.Icon; import android.provider.Settings; import android.support.annotation.NonNull; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; import android.support.annotation.VisibleForTesting; import android.telecom.CallAudioState; import android.telecom.CallAudioState; Loading @@ -41,6 +42,7 @@ import com.android.incallui.call.DialerCall; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; import com.android.newbubble.NewBubble; import com.android.newbubble.NewBubble; import com.android.newbubble.NewBubbleComponent; import com.android.newbubble.NewBubbleInfo; import com.android.newbubble.NewBubbleInfo; import com.android.newbubble.NewBubbleInfo.Action; import com.android.newbubble.NewBubbleInfo.Action; import java.lang.ref.WeakReference; import java.lang.ref.WeakReference; Loading @@ -58,6 +60,8 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) NewBubble bubble; NewBubble bubble; private static Boolean canShowBubblesForTesting = null; private CallAudioState audioState; private CallAudioState audioState; private final PendingIntent toggleSpeaker; private final PendingIntent toggleSpeaker; Loading Loading @@ -132,13 +136,32 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au startContactInfoSearch(); startContactInfoSearch(); } } /** * Determines whether bubbles can be shown based on permissions obtained. This should be checked * before attempting to create a Bubble. * * @return true iff bubbles are able to be shown. * @see Settings#canDrawOverlays(Context) */ private static boolean canShowBubbles(@NonNull Context context) { return canShowBubblesForTesting != null ? canShowBubblesForTesting : Settings.canDrawOverlays(context); } @VisibleForTesting(otherwise = VisibleForTesting.NONE) static void setCanShowBubblesForTesting(boolean canShowBubbles) { canShowBubblesForTesting = canShowBubbles; } @VisibleForTesting @VisibleForTesting public NewBubble startBubble() { public NewBubble startBubble() { if (!NewBubble.canShowBubbles(context)) { if (!canShowBubbles(context)) { LogUtil.i("ReturnToCallController.startNewBubble", "can't show bubble, no permission"); LogUtil.i("ReturnToCallController.startNewBubble", "can't show bubble, no permission"); return null; return null; } } NewBubble returnToCallBubble = NewBubble.createBubble(context, generateBubbleInfo()); NewBubble returnToCallBubble = NewBubbleComponent.get(context).getNewBubble(); returnToCallBubble.setBubbleInfo(generateBubbleInfo()); returnToCallBubble.show(); returnToCallBubble.show(); return returnToCallBubble; return returnToCallBubble; } } Loading java/com/android/newbubble/AndroidManifest.xmldeleted 100644 → 0 +0 −22 Original line number Original line Diff line number Diff line <!-- ~ 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 --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.newbubble"> <uses-sdk android:minSdkVersion="23"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> </manifest> Loading
java/com/android/dialer/binary/aosp/AospDialerRootComponent.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.dialer.strictmode.impl.SystemStrictModeModule; import com.android.incallui.calllocation.stub.StubCallLocationModule; import com.android.incallui.calllocation.stub.StubCallLocationModule; import com.android.incallui.maps.stub.StubMapsModule; import com.android.incallui.maps.stub.StubMapsModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.newbubble.stub.StubNewBubbleModule; import com.android.voicemail.impl.VoicemailModule; import com.android.voicemail.impl.VoicemailModule; import dagger.Component; import dagger.Component; import javax.inject.Singleton; import javax.inject.Singleton; Loading @@ -59,6 +60,7 @@ import javax.inject.Singleton; StubCallLocationModule.class, StubCallLocationModule.class, StubDuoModule.class, StubDuoModule.class, StubEnrichedCallModule.class, StubEnrichedCallModule.class, StubNewBubbleModule.class, StubFeedbackModule.class, StubFeedbackModule.class, StubMapsModule.class, StubMapsModule.class, StubSimSuggestionModule.class, StubSimSuggestionModule.class, Loading
java/com/android/dialer/binary/basecomponent/BaseDialerRootComponent.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.dialer.strictmode.StrictModeComponent; import com.android.incallui.calllocation.CallLocationComponent; import com.android.incallui.calllocation.CallLocationComponent; import com.android.incallui.maps.MapsComponent; import com.android.incallui.maps.MapsComponent; import com.android.incallui.speakeasy.SpeakEasyComponent; import com.android.incallui.speakeasy.SpeakEasyComponent; import com.android.newbubble.NewBubbleComponent; import com.android.voicemail.VoicemailComponent; import com.android.voicemail.VoicemailComponent; /** /** Loading @@ -56,6 +57,7 @@ public interface BaseDialerRootComponent FeedbackComponent.HasComponent, FeedbackComponent.HasComponent, MainComponent.HasComponent, MainComponent.HasComponent, MapsComponent.HasComponent, MapsComponent.HasComponent, NewBubbleComponent.HasComponent, PhoneLookupComponent.HasComponent, PhoneLookupComponent.HasComponent, PhoneNumberGeoUtilComponent.HasComponent, PhoneNumberGeoUtilComponent.HasComponent, PreCallComponent.HasComponent, PreCallComponent.HasComponent, Loading
java/com/android/dialer/binary/google/GoogleStubDialerRootComponent.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.dialer.strictmode.impl.SystemStrictModeModule; import com.android.incallui.calllocation.impl.CallLocationModule; import com.android.incallui.calllocation.impl.CallLocationModule; import com.android.incallui.maps.impl.MapsModule; import com.android.incallui.maps.impl.MapsModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.incallui.speakeasy.StubSpeakEasyModule; import com.android.newbubble.stub.StubNewBubbleModule; import com.android.voicemail.impl.VoicemailModule; import com.android.voicemail.impl.VoicemailModule; import dagger.Component; import dagger.Component; import javax.inject.Singleton; import javax.inject.Singleton; Loading Loading @@ -64,6 +65,7 @@ import javax.inject.Singleton; StubDuoModule.class, StubDuoModule.class, StubEnrichedCallModule.class, StubEnrichedCallModule.class, StubFeedbackModule.class, StubFeedbackModule.class, StubNewBubbleModule.class, StubSimSuggestionModule.class, StubSimSuggestionModule.class, StubSpamModule.class, StubSpamModule.class, StubSpeakEasyModule.class, StubSpeakEasyModule.class, Loading
java/com/android/incallui/NewReturnToCallController.java +25 −2 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.content.Intent; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.graphics.drawable.Icon; import android.provider.Settings; import android.support.annotation.NonNull; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; import android.support.annotation.VisibleForTesting; import android.telecom.CallAudioState; import android.telecom.CallAudioState; Loading @@ -41,6 +42,7 @@ import com.android.incallui.call.DialerCall; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; import com.android.newbubble.NewBubble; import com.android.newbubble.NewBubble; import com.android.newbubble.NewBubbleComponent; import com.android.newbubble.NewBubbleInfo; import com.android.newbubble.NewBubbleInfo; import com.android.newbubble.NewBubbleInfo.Action; import com.android.newbubble.NewBubbleInfo.Action; import java.lang.ref.WeakReference; import java.lang.ref.WeakReference; Loading @@ -58,6 +60,8 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) NewBubble bubble; NewBubble bubble; private static Boolean canShowBubblesForTesting = null; private CallAudioState audioState; private CallAudioState audioState; private final PendingIntent toggleSpeaker; private final PendingIntent toggleSpeaker; Loading Loading @@ -132,13 +136,32 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au startContactInfoSearch(); startContactInfoSearch(); } } /** * Determines whether bubbles can be shown based on permissions obtained. This should be checked * before attempting to create a Bubble. * * @return true iff bubbles are able to be shown. * @see Settings#canDrawOverlays(Context) */ private static boolean canShowBubbles(@NonNull Context context) { return canShowBubblesForTesting != null ? canShowBubblesForTesting : Settings.canDrawOverlays(context); } @VisibleForTesting(otherwise = VisibleForTesting.NONE) static void setCanShowBubblesForTesting(boolean canShowBubbles) { canShowBubblesForTesting = canShowBubbles; } @VisibleForTesting @VisibleForTesting public NewBubble startBubble() { public NewBubble startBubble() { if (!NewBubble.canShowBubbles(context)) { if (!canShowBubbles(context)) { LogUtil.i("ReturnToCallController.startNewBubble", "can't show bubble, no permission"); LogUtil.i("ReturnToCallController.startNewBubble", "can't show bubble, no permission"); return null; return null; } } NewBubble returnToCallBubble = NewBubble.createBubble(context, generateBubbleInfo()); NewBubble returnToCallBubble = NewBubbleComponent.get(context).getNewBubble(); returnToCallBubble.setBubbleInfo(generateBubbleInfo()); returnToCallBubble.show(); returnToCallBubble.show(); return returnToCallBubble; return returnToCallBubble; } } Loading
java/com/android/newbubble/AndroidManifest.xmldeleted 100644 → 0 +0 −22 Original line number Original line Diff line number Diff line <!-- ~ 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 --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.newbubble"> <uses-sdk android:minSdkVersion="23"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> </manifest>