diff options
Diffstat (limited to 'java/com/android/dialer/main/impl/NewMainActivityPeer.java')
-rw-r--r-- | java/com/android/dialer/main/impl/NewMainActivityPeer.java | 17 |
1 files changed, 16 insertions, 1 deletions
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 |