diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-05 09:08:20 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-05-05 09:08:20 -0700 |
commit | 738bb09adee2b56c99063a0264f8f76de393143b (patch) | |
tree | 7759f57348ab1864a745c831a64be761148b60d7 /java/com/android/dialer/app/list/SmartDialSearchFragment.java | |
parent | 10b34a5ebf12e97ecba0caf3c8e30b476b038a96 (diff) |
Update Dialer to v10 RC17
This release was created following the instructions at:
go/dialer-aosp-release
Subsequent dialer releases will follow as O bugs are
fixed, until we reach our final RC.
Version: 10
Candidate: RC17
Branch: dialer-android_release_branch/153304843.1
dialer-android/dialer-android_20170416.00/dialer-android_20170416.00_RC17
This release contains the following bug fixes since RC16:
Bug: 37962346
Test: make, on device
Change-Id: I1852cc096ef242c7bfcd85b11f954ddb00903c39
Diffstat (limited to 'java/com/android/dialer/app/list/SmartDialSearchFragment.java')
-rw-r--r-- | java/com/android/dialer/app/list/SmartDialSearchFragment.java | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/list/SmartDialSearchFragment.java b/java/com/android/dialer/app/list/SmartDialSearchFragment.java index 5d72ee615..eb1508c72 100644 --- a/java/com/android/dialer/app/list/SmartDialSearchFragment.java +++ b/java/com/android/dialer/app/list/SmartDialSearchFragment.java @@ -18,6 +18,10 @@ package com.android.dialer.app.list; import static android.Manifest.permission.CALL_PHONE; import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; import android.content.Loader; import android.database.Cursor; import android.os.Bundle; @@ -27,6 +31,8 @@ import com.android.dialer.app.R; import com.android.dialer.app.dialpad.SmartDialCursorLoader; import com.android.dialer.app.widget.EmptyContentView; import com.android.dialer.callintent.CallInitiationType; +import com.android.dialer.common.LogUtil; +import com.android.dialer.database.DialerDatabaseHelper; import com.android.dialer.util.PermissionsUtil; /** Implements a fragment to load and display SmartDial search results. */ @@ -34,10 +40,17 @@ public class SmartDialSearchFragment extends SearchFragment implements EmptyContentView.OnEmptyViewActionButtonClickedListener, FragmentCompat.OnRequestPermissionsResultCallback { - private static final String TAG = SmartDialSearchFragment.class.getSimpleName(); - private static final int CALL_PHONE_PERMISSION_REQUEST_CODE = 1; + private final BroadcastReceiver mSmartDialUpdatedReceiver = + new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + LogUtil.i("SmartDialSearchFragment.onReceive", "smart dial update broadcast received"); + reloadData(); + } + }; + /** Creates a SmartDialListAdapter to display and operate on search results. */ @Override protected ContactEntryListAdapter createListAdapter() { @@ -83,6 +96,27 @@ public class SmartDialSearchFragment extends SearchFragment } @Override + public void onStart() { + super.onStart(); + + LogUtil.i("SmartDialSearchFragment.onStart", "registering smart dial update receiver"); + + getActivity() + .registerReceiver( + mSmartDialUpdatedReceiver, + new IntentFilter(DialerDatabaseHelper.ACTION_SMART_DIAL_UPDATED)); + } + + @Override + public void onStop() { + super.onStop(); + + LogUtil.i("SmartDialSearchFragment.onStop", "unregistering smart dial update receiver"); + + getActivity().unregisterReceiver(mSmartDialUpdatedReceiver); + } + + @Override public void onEmptyViewActionButtonClicked() { final Activity activity = getActivity(); if (activity == null) { |