diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-02-26 20:17:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-02-26 20:17:29 +0000 |
commit | 95eb620cd640a1bce50d8c87e0802f90b5bb9ecd (patch) | |
tree | d570f076bea55bc2446a3edd3c50d1b6bc023d8a /java/com/android/dialer/main | |
parent | 19a126b0c12c0ea93ffe7f60f3250e81aa305785 (diff) | |
parent | 719341fb552ddb1b1e955e0f8ace79ffc0491b67 (diff) |
Merge "Implement logic of bottom sheet options related to spam numbers."
Diffstat (limited to 'java/com/android/dialer/main')
4 files changed, 27 insertions, 1 deletions
diff --git a/java/com/android/dialer/main/MainActivityPeer.java b/java/com/android/dialer/main/MainActivityPeer.java index 9c5627be8..31af9adbd 100644 --- a/java/com/android/dialer/main/MainActivityPeer.java +++ b/java/com/android/dialer/main/MainActivityPeer.java @@ -28,6 +28,8 @@ public interface MainActivityPeer { void onUserLeaveHint(); + void onActivityPause(); + void onActivityStop(); void onActivityDestroyed(); diff --git a/java/com/android/dialer/main/impl/MainActivity.java b/java/com/android/dialer/main/impl/MainActivity.java index 1646becf4..fbcbeff38 100644 --- a/java/com/android/dialer/main/impl/MainActivity.java +++ b/java/com/android/dialer/main/impl/MainActivity.java @@ -99,6 +99,12 @@ public class MainActivity extends TransactionSafeActivity } @Override + protected void onPause() { + super.onPause(); + activePeer.onActivityPause(); + } + + @Override protected void onStop() { super.onStop(); activePeer.onActivityStop(); diff --git a/java/com/android/dialer/main/impl/NewMainActivityPeer.java b/java/com/android/dialer/main/impl/NewMainActivityPeer.java index 6f5c18623..081559a2b 100644 --- a/java/com/android/dialer/main/impl/NewMainActivityPeer.java +++ b/java/com/android/dialer/main/impl/NewMainActivityPeer.java @@ -22,6 +22,8 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; +import android.support.v4.content.LocalBroadcastManager; +import com.android.dialer.blockreportspam.ShowBlockReportSpamDialogReceiver; import com.android.dialer.calllog.CallLogComponent; import com.android.dialer.calllog.ui.NewCallLogFragment; import com.android.dialer.common.concurrent.DefaultFutureCallback; @@ -37,9 +39,12 @@ import com.google.common.util.concurrent.MoreExecutors; public class NewMainActivityPeer implements MainActivityPeer { private final MainActivity mainActivity; + private final ShowBlockReportSpamDialogReceiver showBlockReportSpamDialogReceiver; public NewMainActivityPeer(MainActivity mainActivity) { this.mainActivity = mainActivity; + this.showBlockReportSpamDialogReceiver = + new ShowBlockReportSpamDialogReceiver(mainActivity.getFragmentManager()); } @Override @@ -54,12 +59,22 @@ public class NewMainActivityPeer implements MainActivityPeer { } @Override - public void onActivityResume() {} + public void onActivityResume() { + LocalBroadcastManager.getInstance(mainActivity) + .registerReceiver( + showBlockReportSpamDialogReceiver, ShowBlockReportSpamDialogReceiver.getIntentFilter()); + } @Override public void onUserLeaveHint() {} @Override + public void onActivityPause() { + LocalBroadcastManager.getInstance(mainActivity) + .unregisterReceiver(showBlockReportSpamDialogReceiver); + } + + @Override public void onActivityStop() {} @Override diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java index cdbab5cc1..9ceea28bf 100644 --- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java +++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java @@ -398,6 +398,9 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen } @Override + public void onActivityPause() {} + + @Override public void onActivityStop() { lastTabController.onActivityStop(); callLogFragmentListener.onActivityStop( |