Loading src/com/android/dialer/DialtactsActivity.java +3 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O menu.findItem(R.id.menu_import_export).setVisible(hasContactsPermission); menu.findItem(R.id.menu_add_contact).setVisible(hasContactsPermission); menu.findItem(R.id.menu_history).setVisible( PermissionsUtil.hasPhonePermissions(DialtactsActivity.this)); super.show(); } } Loading src/com/android/dialer/calllog/CallLogFragment.java +3 −4 Original line number Diff line number Diff line Loading @@ -188,7 +188,6 @@ public class CallLogFragment extends Fragment mContactsObserver); resolver.registerContentObserver(Status.CONTENT_URI, true, mVoicemailStatusObserver); setHasOptionsMenu(true); fetchCalls(); } /** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */ Loading @@ -203,7 +202,7 @@ public class CallLogFragment extends Fragment // This will update the state of the "Clear call log" menu item. getActivity().invalidateOptionsMenu(); boolean showListView = cursor.getCount() > 0; boolean showListView = cursor != null && cursor.getCount() > 0; mRecyclerView.setVisibility(showListView ? View.VISIBLE : View.GONE); mEmptyListView.setVisibility(!showListView ? View.VISIBLE : View.GONE); Loading Loading @@ -266,6 +265,7 @@ public class CallLogFragment extends Fragment mRecyclerView.setHasFixedSize(true); mLayoutManager = new LinearLayoutManager(getActivity()); mRecyclerView.setLayoutManager(mLayoutManager); mEmptyListView = view.findViewById(R.id.empty_list_view); String currentCountryIso = GeoUtil.getCurrentCountryIso(getActivity()); boolean isShowingRecentsTab = mLogLimit != NO_LOG_LIMIT || mDateLimit != NO_DATE_LIMIT; Loading @@ -278,14 +278,13 @@ public class CallLogFragment extends Fragment mRecyclerView.setAdapter(mAdapter); mVoicemailStatusHelper = new VoicemailStatusHelperImpl(); fetchCalls(); return view; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mEmptyListView = view.findViewById(R.id.empty_list_view); updateEmptyMessage(mCallTypeFilter); } Loading src/com/android/dialer/calllog/CallLogNotificationsService.java +5 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Intent; import android.net.Uri; import android.util.Log; import com.android.contacts.common.util.PermissionsUtil; import com.android.dialer.util.TelecomUtil; /** Loading Loading @@ -78,6 +79,10 @@ public class CallLogNotificationsService extends IntentService { return; } if (!PermissionsUtil.hasPhonePermissions(this)) { return; } if (ACTION_MARK_NEW_VOICEMAILS_AS_OLD.equals(intent.getAction())) { mVoicemailQueryHandler.markNewVoicemailsAsOld(); } else if (ACTION_UPDATE_NOTIFICATIONS.equals(intent.getAction())) { Loading src/com/android/dialer/calllog/CallLogQueryHandler.java +16 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.provider.VoicemailContract.Voicemails; import android.util.Log; import com.android.contacts.common.database.NoNullCursorAsyncQueryHandler; import com.android.contacts.common.util.PermissionsUtil; import com.android.dialer.util.TelecomUtil; import com.android.dialer.voicemail.VoicemailStatusHelperImpl; Loading Loading @@ -93,6 +94,10 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { Log.w(TAG, "Exception on background worker thread", e); } catch (IllegalArgumentException e) { Log.w(TAG, "ContactsProvider not present on device", e); } catch (SecurityException e) { // Shouldn't happen if we are protecting the entry points correctly, // but just in case. Log.w(TAG, "No permission to access ContactsProvider.", e); } } } Loading Loading @@ -124,7 +129,11 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { */ public void fetchCalls(int callType, long newerThan) { cancelFetch(); if (PermissionsUtil.hasPhonePermissions(mContext)) { fetchCalls(QUERY_CALLLOG_TOKEN, callType, false /* newOnly */, newerThan); } else { updateAdapterData(null); } } public void fetchCalls(int callType) { Loading Loading @@ -187,6 +196,9 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { /** Updates all new calls to mark them as old. */ public void markNewCallsAsOld() { if (!PermissionsUtil.hasPhonePermissions(mContext)) { return; } // Mark all "new" calls as not new anymore. StringBuilder where = new StringBuilder(); where.append(Calls.NEW); Loading @@ -201,6 +213,9 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { /** Updates all missed calls to mark them as read. */ public void markMissedCallsAsRead() { if (!PermissionsUtil.hasPhonePermissions(mContext)) { return; } // Mark all "new" calls as not new anymore. StringBuilder where = new StringBuilder(); where.append(Calls.IS_READ).append(" = 0"); Loading src/com/android/dialer/dialpad/DialpadFragment.java +3 −0 Original line number Diff line number Diff line Loading @@ -1600,6 +1600,9 @@ public class DialpadFragment extends Fragment */ private void queryLastOutgoingCall() { mLastNumberDialed = EMPTY_NUMBER; if (!PermissionsUtil.hasPhonePermissions(getActivity())) { return; } CallLogAsync.GetLastOutgoingCallArgs lastCallArgs = new CallLogAsync.GetLastOutgoingCallArgs( getActivity(), Loading Loading
src/com/android/dialer/DialtactsActivity.java +3 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O menu.findItem(R.id.menu_import_export).setVisible(hasContactsPermission); menu.findItem(R.id.menu_add_contact).setVisible(hasContactsPermission); menu.findItem(R.id.menu_history).setVisible( PermissionsUtil.hasPhonePermissions(DialtactsActivity.this)); super.show(); } } Loading
src/com/android/dialer/calllog/CallLogFragment.java +3 −4 Original line number Diff line number Diff line Loading @@ -188,7 +188,6 @@ public class CallLogFragment extends Fragment mContactsObserver); resolver.registerContentObserver(Status.CONTENT_URI, true, mVoicemailStatusObserver); setHasOptionsMenu(true); fetchCalls(); } /** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */ Loading @@ -203,7 +202,7 @@ public class CallLogFragment extends Fragment // This will update the state of the "Clear call log" menu item. getActivity().invalidateOptionsMenu(); boolean showListView = cursor.getCount() > 0; boolean showListView = cursor != null && cursor.getCount() > 0; mRecyclerView.setVisibility(showListView ? View.VISIBLE : View.GONE); mEmptyListView.setVisibility(!showListView ? View.VISIBLE : View.GONE); Loading Loading @@ -266,6 +265,7 @@ public class CallLogFragment extends Fragment mRecyclerView.setHasFixedSize(true); mLayoutManager = new LinearLayoutManager(getActivity()); mRecyclerView.setLayoutManager(mLayoutManager); mEmptyListView = view.findViewById(R.id.empty_list_view); String currentCountryIso = GeoUtil.getCurrentCountryIso(getActivity()); boolean isShowingRecentsTab = mLogLimit != NO_LOG_LIMIT || mDateLimit != NO_DATE_LIMIT; Loading @@ -278,14 +278,13 @@ public class CallLogFragment extends Fragment mRecyclerView.setAdapter(mAdapter); mVoicemailStatusHelper = new VoicemailStatusHelperImpl(); fetchCalls(); return view; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mEmptyListView = view.findViewById(R.id.empty_list_view); updateEmptyMessage(mCallTypeFilter); } Loading
src/com/android/dialer/calllog/CallLogNotificationsService.java +5 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Intent; import android.net.Uri; import android.util.Log; import com.android.contacts.common.util.PermissionsUtil; import com.android.dialer.util.TelecomUtil; /** Loading Loading @@ -78,6 +79,10 @@ public class CallLogNotificationsService extends IntentService { return; } if (!PermissionsUtil.hasPhonePermissions(this)) { return; } if (ACTION_MARK_NEW_VOICEMAILS_AS_OLD.equals(intent.getAction())) { mVoicemailQueryHandler.markNewVoicemailsAsOld(); } else if (ACTION_UPDATE_NOTIFICATIONS.equals(intent.getAction())) { Loading
src/com/android/dialer/calllog/CallLogQueryHandler.java +16 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.provider.VoicemailContract.Voicemails; import android.util.Log; import com.android.contacts.common.database.NoNullCursorAsyncQueryHandler; import com.android.contacts.common.util.PermissionsUtil; import com.android.dialer.util.TelecomUtil; import com.android.dialer.voicemail.VoicemailStatusHelperImpl; Loading Loading @@ -93,6 +94,10 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { Log.w(TAG, "Exception on background worker thread", e); } catch (IllegalArgumentException e) { Log.w(TAG, "ContactsProvider not present on device", e); } catch (SecurityException e) { // Shouldn't happen if we are protecting the entry points correctly, // but just in case. Log.w(TAG, "No permission to access ContactsProvider.", e); } } } Loading Loading @@ -124,7 +129,11 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { */ public void fetchCalls(int callType, long newerThan) { cancelFetch(); if (PermissionsUtil.hasPhonePermissions(mContext)) { fetchCalls(QUERY_CALLLOG_TOKEN, callType, false /* newOnly */, newerThan); } else { updateAdapterData(null); } } public void fetchCalls(int callType) { Loading Loading @@ -187,6 +196,9 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { /** Updates all new calls to mark them as old. */ public void markNewCallsAsOld() { if (!PermissionsUtil.hasPhonePermissions(mContext)) { return; } // Mark all "new" calls as not new anymore. StringBuilder where = new StringBuilder(); where.append(Calls.NEW); Loading @@ -201,6 +213,9 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { /** Updates all missed calls to mark them as read. */ public void markMissedCallsAsRead() { if (!PermissionsUtil.hasPhonePermissions(mContext)) { return; } // Mark all "new" calls as not new anymore. StringBuilder where = new StringBuilder(); where.append(Calls.IS_READ).append(" = 0"); Loading
src/com/android/dialer/dialpad/DialpadFragment.java +3 −0 Original line number Diff line number Diff line Loading @@ -1600,6 +1600,9 @@ public class DialpadFragment extends Fragment */ private void queryLastOutgoingCall() { mLastNumberDialed = EMPTY_NUMBER; if (!PermissionsUtil.hasPhonePermissions(getActivity())) { return; } CallLogAsync.GetLastOutgoingCallArgs lastCallArgs = new CallLogAsync.GetLastOutgoingCallArgs( getActivity(), Loading