diff options
Diffstat (limited to 'java/com/android')
56 files changed, 189 insertions, 177 deletions
diff --git a/java/com/android/contacts/common/ContactTileLoaderFactory.java b/java/com/android/contacts/common/ContactTileLoaderFactory.java index 0791517ca..d71472ef8 100644 --- a/java/com/android/contacts/common/ContactTileLoaderFactory.java +++ b/java/com/android/contacts/common/ContactTileLoaderFactory.java @@ -16,12 +16,12 @@ package com.android.contacts.common; import android.content.Context; +import android.content.CursorLoader; import android.net.Uri; import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Contacts; import android.support.annotation.VisibleForTesting; -import android.support.v4.content.CursorLoader; /** * Used to create {@link CursorLoader} which finds contacts information from the strequents table. diff --git a/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java b/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java index 60c7fc0ac..751490a22 100644 --- a/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java +++ b/java/com/android/contacts/common/dialog/ClearFrequentsDialog.java @@ -18,6 +18,8 @@ package com.android.contacts.common.dialog; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; +import android.app.FragmentManager; import android.app.ProgressDialog; import android.content.ContentResolver; import android.content.Context; @@ -26,8 +28,6 @@ import android.content.DialogInterface.OnClickListener; import android.os.AsyncTask; import android.os.Bundle; import android.provider.ContactsContract; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.FragmentManager; import com.android.contacts.common.R; import com.android.dialer.util.PermissionsUtil; diff --git a/java/com/android/contacts/common/list/ContactEntryListAdapter.java b/java/com/android/contacts/common/list/ContactEntryListAdapter.java index 19e43d81e..7335297e0 100644 --- a/java/com/android/contacts/common/list/ContactEntryListAdapter.java +++ b/java/com/android/contacts/common/list/ContactEntryListAdapter.java @@ -16,6 +16,7 @@ package com.android.contacts.common.list; import android.content.Context; +import android.content.CursorLoader; import android.content.res.Resources; import android.database.Cursor; import android.net.Uri; @@ -24,7 +25,6 @@ import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Directory; -import android.support.v4.content.CursorLoader; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; diff --git a/java/com/android/contacts/common/list/ContactEntryListFragment.java b/java/com/android/contacts/common/list/ContactEntryListFragment.java index d39c5af5c..04658be89 100644 --- a/java/com/android/contacts/common/list/ContactEntryListFragment.java +++ b/java/com/android/contacts/common/list/ContactEntryListFragment.java @@ -16,7 +16,12 @@ package com.android.contacts.common.list; +import android.app.Fragment; +import android.app.LoaderManager; +import android.app.LoaderManager.LoaderCallbacks; import android.content.Context; +import android.content.CursorLoader; +import android.content.Loader; import android.database.Cursor; import android.os.Bundle; import android.os.Handler; @@ -24,11 +29,6 @@ import android.os.Message; import android.os.Parcelable; import android.provider.ContactsContract.Directory; import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.LoaderManager; -import android.support.v4.app.LoaderManager.LoaderCallbacks; -import android.support.v4.content.CursorLoader; -import android.support.v4.content.Loader; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.MotionEvent; diff --git a/java/com/android/contacts/common/list/DefaultContactListAdapter.java b/java/com/android/contacts/common/list/DefaultContactListAdapter.java index 115434e18..7bcae0e0e 100644 --- a/java/com/android/contacts/common/list/DefaultContactListAdapter.java +++ b/java/com/android/contacts/common/list/DefaultContactListAdapter.java @@ -16,6 +16,7 @@ package com.android.contacts.common.list; import android.content.Context; +import android.content.CursorLoader; import android.content.SharedPreferences; import android.database.Cursor; import android.net.Uri; @@ -25,7 +26,6 @@ import android.provider.ContactsContract; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Directory; import android.provider.ContactsContract.SearchSnippets; -import android.support.v4.content.CursorLoader; import android.text.TextUtils; import android.view.View; import com.android.contacts.common.compat.ContactsCompat; diff --git a/java/com/android/contacts/common/list/DirectoryListLoader.java b/java/com/android/contacts/common/list/DirectoryListLoader.java index 89c6b2f4c..be62cc7a8 100644 --- a/java/com/android/contacts/common/list/DirectoryListLoader.java +++ b/java/com/android/contacts/common/list/DirectoryListLoader.java @@ -15,6 +15,7 @@ */ package com.android.contacts.common.list; +import android.content.AsyncTaskLoader; import android.content.Context; import android.content.pm.PackageManager; import android.database.ContentObserver; @@ -23,7 +24,6 @@ import android.database.MatrixCursor; import android.net.Uri; import android.os.Handler; import android.provider.ContactsContract.Directory; -import android.support.v4.content.AsyncTaskLoader; import android.text.TextUtils; import com.android.contacts.common.R; import com.android.contacts.common.compat.DirectoryCompat; diff --git a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java index 395024708..d1118c3c7 100644 --- a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java +++ b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java @@ -17,6 +17,7 @@ package com.android.contacts.common.list; import android.content.Context; +import android.content.CursorLoader; import android.database.Cursor; import android.net.Uri; import android.net.Uri.Builder; @@ -26,7 +27,6 @@ import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.CommonDataKinds.SipAddress; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Directory; -import android.support.v4.content.CursorLoader; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; diff --git a/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java b/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java index e9083ae78..558f3b209 100644 --- a/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java +++ b/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java @@ -17,11 +17,11 @@ package com.android.contacts.common.list; import android.content.ComponentName; import android.content.Intent; +import android.content.Loader; import android.database.Cursor; import android.os.Bundle; import android.support.annotation.MainThread; import android.support.annotation.Nullable; -import android.support.v4.content.Loader; import android.text.TextUtils; import android.util.ArraySet; import android.view.LayoutInflater; diff --git a/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java b/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java index 99c18468b..8156d97cf 100644 --- a/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java +++ b/java/com/android/contacts/common/widget/SelectPhoneAccountDialogFragment.java @@ -19,13 +19,13 @@ package com.android.contacts.common.widget; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; import android.os.ResultReceiver; import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 48c916707..1c9718e40 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -16,6 +16,8 @@ package com.android.dialer.app; +import android.app.Fragment; +import android.app.FragmentTransaction; import android.app.KeyguardManager; import android.content.ActivityNotFoundException; import android.content.Context; @@ -38,8 +40,6 @@ import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentTransaction; import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; import android.telecom.PhoneAccount; @@ -204,6 +204,11 @@ public class DialtactsActivity extends TransactionSafeActivity private Animation mSlideOut; /** Fragment containing the speed dial list, call history list, and all contacts list. */ private ListsFragment mListsFragment; + /** + * Tracks whether onSaveInstanceState has been called. If true, no fragment transactions can be + * commited. + */ + private boolean mStateSaved; private boolean mIsRestarting; private boolean mInDialpadSearch; @@ -400,12 +405,12 @@ public class DialtactsActivity extends TransactionSafeActivity actionBar.setBackgroundDrawable(null); SearchEditTextLayout searchEditTextLayout = - actionBar.getCustomView().findViewById(R.id.search_view_container); + (SearchEditTextLayout) actionBar.getCustomView().findViewById(R.id.search_view_container); searchEditTextLayout.setPreImeKeyListener(mSearchEditTextLayoutListener); mActionBarController = new ActionBarController(this, searchEditTextLayout); - mSearchView = searchEditTextLayout.findViewById(R.id.search_view); + mSearchView = (EditText) searchEditTextLayout.findViewById(R.id.search_view); mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener); mVoiceSearchButton = searchEditTextLayout.findViewById(R.id.voice_search_button); searchEditTextLayout @@ -428,13 +433,14 @@ public class DialtactsActivity extends TransactionSafeActivity mIsLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; mPreviouslySelectedTabIndex = DialtactsPagerAdapter.TAB_INDEX_SPEED_DIAL; - FloatingActionButton floatingActionButton = findViewById(R.id.floating_action_button); + FloatingActionButton floatingActionButton = + (FloatingActionButton) findViewById(R.id.floating_action_button); floatingActionButton.setOnClickListener(this); mFloatingActionButtonController = new FloatingActionButtonController(this, floatingActionButton); ImageButton optionsMenuButton = - searchEditTextLayout.findViewById(R.id.dialtacts_options_menu_button); + (ImageButton) searchEditTextLayout.findViewById(R.id.dialtacts_options_menu_button); optionsMenuButton.setOnClickListener(this); mOverflowMenu = buildOptionsMenu(optionsMenuButton); optionsMenuButton.setOnTouchListener(mOverflowMenu.getDragToOpenListener()); @@ -442,7 +448,7 @@ public class DialtactsActivity extends TransactionSafeActivity // Add the favorites fragment but only if savedInstanceState is null. Otherwise the // fragment manager is responsible for recreating it. if (savedInstanceState == null) { - getSupportFragmentManager() + getFragmentManager() .beginTransaction() .add(R.id.dialtacts_frame, new ListsFragment(), TAG_FAVORITES_FRAGMENT) .commit(); @@ -475,7 +481,7 @@ public class DialtactsActivity extends TransactionSafeActivity mSlideIn.setAnimationListener(mSlideInListener); mSlideOut.setAnimationListener(mSlideOutListener); - mParentLayout = findViewById(R.id.dialtacts_mainlayout); + mParentLayout = (CoordinatorLayout) findViewById(R.id.dialtacts_mainlayout); mParentLayout.setOnDragListener(new LayoutOnDragListener()); ViewUtil.doOnGlobalLayout( floatingActionButton, @@ -515,6 +521,7 @@ public class DialtactsActivity extends TransactionSafeActivity PerformanceReport.startRecording(); } + mStateSaved = false; if (mFirstLaunch) { displayFragment(getIntent()); } else if (!phoneIsInUse() && mInCallDialpadUp) { @@ -644,6 +651,7 @@ public class DialtactsActivity extends TransactionSafeActivity outState.putBoolean(KEY_IS_DIALPAD_SHOWN, mIsDialpadShown); outState.putBoolean(KEY_WAS_CONFIGURATION_CHANGE, isChangingConfigurations()); mActionBarController.saveInstanceState(outState); + mStateSaved = true; } @Override @@ -652,7 +660,7 @@ public class DialtactsActivity extends TransactionSafeActivity if (fragment instanceof DialpadFragment) { mDialpadFragment = (DialpadFragment) fragment; if (!mIsDialpadShown && !mShowDialpadOnResume) { - final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); + final FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.hide(mDialpadFragment); transaction.commit(); } @@ -739,7 +747,7 @@ public class DialtactsActivity extends TransactionSafeActivity final Intent intent = new Intent(this, CallLogActivity.class); startActivity(intent); } else if (resId == R.id.menu_clear_frequents) { - ClearFrequentsDialog.show(getSupportFragmentManager()); + ClearFrequentsDialog.show(getFragmentManager()); Logger.get(this).logScreenView(ScreenEvent.Type.CLEAR_FREQUENTS, this); return true; } else if (resId == R.id.menu_call_settings) { @@ -816,14 +824,14 @@ public class DialtactsActivity extends TransactionSafeActivity */ private void showDialpadFragment(boolean animate) { LogUtil.d("DialtactActivity.showDialpadFragment", "animate: %b", animate); - if (mIsDialpadShown || getSupportFragmentManager().isStateSaved()) { + if (mIsDialpadShown || mStateSaved) { return; } mIsDialpadShown = true; mListsFragment.setUserVisibleHint(false); - final FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + final FragmentTransaction ft = getFragmentManager().beginTransaction(); if (mDialpadFragment == null) { mDialpadFragment = new DialpadFragment(); ft.add(R.id.dialtacts_container, mDialpadFragment, TAG_DIALPAD_FRAGMENT); @@ -846,7 +854,7 @@ public class DialtactsActivity extends TransactionSafeActivity Assert.isNotNull(mListsFragment.getView()).animate().alpha(0).withLayer(); - // adjust the title, so the user will know where we're at when the activity start/resumes. + //adjust the title, so the user will know where we're at when the activity start/resumes. setTitle(R.string.launcherDialpadActivityLabel); } @@ -908,17 +916,17 @@ public class DialtactsActivity extends TransactionSafeActivity exitSearchUi(); } } - // reset the title to normal. + //reset the title to normal. setTitle(R.string.launcherActivityLabel); } /** Finishes hiding the dialpad fragment after any animations are completed. */ private void commitDialpadFragmentHide() { - if (!getSupportFragmentManager().isStateSaved() + if (!mStateSaved && mDialpadFragment != null && !mDialpadFragment.isHidden() && !isDestroyed()) { - final FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.hide(mDialpadFragment); ft.commit(); } @@ -990,7 +998,8 @@ public class DialtactsActivity extends TransactionSafeActivity /** Sets the hint text for the contacts search box */ private void setSearchBoxHint() { SearchEditTextLayout searchEditTextLayout = - getActionBarSafely().getCustomView().findViewById(R.id.search_view_container); + (SearchEditTextLayout) + getActionBarSafely().getCustomView().findViewById(R.id.search_view_container); ((TextView) searchEditTextLayout.findViewById(R.id.search_box_start_search)) .setHint(getSearchBoxHint()); } @@ -1080,6 +1089,7 @@ public class DialtactsActivity extends TransactionSafeActivity setIntent(newIntent); mFirstLaunch = true; + mStateSaved = false; displayFragment(newIntent); invalidateOptionsMenu(); @@ -1102,7 +1112,7 @@ public class DialtactsActivity extends TransactionSafeActivity /** Shows the search fragment */ private void enterSearchUi(boolean smartDialSearch, String query, boolean animate) { - if (getSupportFragmentManager().isStateSaved() || getSupportFragmentManager().isDestroyed()) { + if (mStateSaved || getFragmentManager().isDestroyed()) { // Weird race condition where fragment is doing work after the activity is destroyed // due to talkback being on (b/10209937). Just return since we can't do any // constructive here. @@ -1113,7 +1123,7 @@ public class DialtactsActivity extends TransactionSafeActivity LogUtil.v("DialtactsActivity.enterSearchUi", "smart dial " + smartDialSearch); } - final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); + final FragmentTransaction transaction = getFragmentManager().beginTransaction(); if (mInDialpadSearch && mSmartDialSearchFragment != null) { transaction.remove(mSmartDialSearchFragment); } else if (mInRegularSearch && mRegularSearchFragment != null) { @@ -1141,7 +1151,7 @@ public class DialtactsActivity extends TransactionSafeActivity transaction.setTransition(FragmentTransaction.TRANSIT_NONE); } - Fragment fragment = getSupportFragmentManager().findFragmentByTag(tag); + Fragment fragment = getFragmentManager().findFragmentByTag(tag); if (fragment == null) { if (useNewSearch) { fragment = new NewSearchFragment(); @@ -1199,7 +1209,7 @@ public class DialtactsActivity extends TransactionSafeActivity /** Hides the search fragment */ private void exitSearchUi() { // See related bug in enterSearchUI(); - if (getSupportFragmentManager().isStateSaved() || getSupportFragmentManager().isDestroyed()) { + if (getFragmentManager().isDestroyed() || mStateSaved) { return; } @@ -1219,7 +1229,7 @@ public class DialtactsActivity extends TransactionSafeActivity onPageScrolled(mListsFragment.getCurrentTabIndex(), 0 /* offset */, 0 /* pixelOffset */); onPageSelected(mListsFragment.getCurrentTabIndex()); - final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); + final FragmentTransaction transaction = getFragmentManager().beginTransaction(); if (mSmartDialSearchFragment != null) { transaction.remove(mSmartDialSearchFragment); } @@ -1248,7 +1258,7 @@ public class DialtactsActivity extends TransactionSafeActivity public void onBackPressed() { PerformanceReport.recordClick(UiAction.Type.PRESS_ANDROID_BACK_BUTTON); - if (getSupportFragmentManager().isStateSaved()) { + if (mStateSaved) { return; } if (mIsDialpadShown) { diff --git a/java/com/android/dialer/app/SpecialCharSequenceMgr.java b/java/com/android/dialer/app/SpecialCharSequenceMgr.java index 0d4182c42..20222d68c 100644 --- a/java/com/android/dialer/app/SpecialCharSequenceMgr.java +++ b/java/com/android/dialer/app/SpecialCharSequenceMgr.java @@ -16,7 +16,9 @@ package com.android.dialer.app; +import android.app.Activity; import android.app.AlertDialog; +import android.app.DialogFragment; import android.app.KeyguardManager; import android.app.ProgressDialog; import android.content.ActivityNotFoundException; @@ -28,8 +30,6 @@ import android.database.Cursor; import android.net.Uri; import android.provider.Settings; import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.FragmentActivity; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telephony.PhoneNumberUtils; @@ -96,7 +96,7 @@ public class SpecialCharSequenceMgr { private SpecialCharSequenceMgr() {} public static boolean handleChars(Context context, String input, EditText textField) { - // get rid of the separators so that the string gets parsed correctly + //get rid of the separators so that the string gets parsed correctly String dialString = PhoneNumberUtils.stripSeparators(input); if (handleDeviceIdDisplay(context, dialString) @@ -223,8 +223,7 @@ public class SpecialCharSequenceMgr { DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance( subscriptionAccountHandles, callback, null); - dialogFragment.show( - ((FragmentActivity) context).getSupportFragmentManager(), TAG_SELECT_ACCT_FRAGMENT); + dialogFragment.show(((Activity) context).getFragmentManager(), TAG_SELECT_ACCT_FRAGMENT); } return true; @@ -279,8 +278,7 @@ public class SpecialCharSequenceMgr { DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance( subscriptionAccountHandles, listener, null); - dialogFragment.show( - ((FragmentActivity) context).getSupportFragmentManager(), TAG_SELECT_ACCT_FRAGMENT); + dialogFragment.show(((Activity) context).getFragmentManager(), TAG_SELECT_ACCT_FRAGMENT); } return true; } diff --git a/java/com/android/dialer/app/calllog/BlockReportSpamListener.java b/java/com/android/dialer/app/calllog/BlockReportSpamListener.java index 7c324ffb2..28082df2b 100644 --- a/java/com/android/dialer/app/calllog/BlockReportSpamListener.java +++ b/java/com/android/dialer/app/calllog/BlockReportSpamListener.java @@ -16,11 +16,11 @@ package com.android.dialer.app.calllog; +import android.app.FragmentManager; import android.content.ContentValues; import android.content.Context; import android.net.Uri; import android.support.annotation.NonNull; -import android.support.v4.app.FragmentManager; import android.support.v7.widget.RecyclerView; import com.android.dialer.blocking.BlockReportSpamDialogs; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; diff --git a/java/com/android/dialer/app/calllog/CallLogActivity.java b/java/com/android/dialer/app/calllog/CallLogActivity.java index 449e45742..35e05bc39 100644 --- a/java/com/android/dialer/app/calllog/CallLogActivity.java +++ b/java/com/android/dialer/app/calllog/CallLogActivity.java @@ -15,14 +15,14 @@ */ package com.android.dialer.app.calllog; +import android.app.Fragment; +import android.app.FragmentManager; import android.content.Intent; import android.os.Bundle; import android.provider.CallLog; import android.provider.CallLog.Calls; import android.support.design.widget.Snackbar; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; +import android.support.v13.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; import android.view.Menu; @@ -84,14 +84,14 @@ public class CallLogActivity extends TransactionSafeActivity mTabTitles[0] = getString(R.string.call_log_all_title); mTabTitles[1] = getString(R.string.call_log_missed_title); - mViewPager = findViewById(R.id.call_log_pager); + mViewPager = (ViewPager) findViewById(R.id.call_log_pager); - mViewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager()); + mViewPagerAdapter = new ViewPagerAdapter(getFragmentManager()); mViewPager.setAdapter(mViewPagerAdapter); mViewPager.setOffscreenPageLimit(1); mViewPager.setOnPageChangeListener(this); - mViewPagerTabs = findViewById(R.id.viewpager_header); + mViewPagerTabs = (ViewPagerTabs) findViewById(R.id.viewpager_header); mViewPagerTabs.setViewPager(mViewPager); mViewPager.setCurrentItem(startingTab); @@ -148,7 +148,7 @@ public class CallLogActivity extends TransactionSafeActivity startActivity(intent); return true; } else if (item.getItemId() == R.id.delete_all) { - ClearCallLogDialog.show(getSupportFragmentManager(), this); + ClearCallLogDialog.show(getFragmentManager(), this); return true; } return super.onOptionsItemSelected(item); diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index d7a27dfca..c4156d5c6 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -35,7 +35,6 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; import android.support.annotation.WorkerThread; -import android.support.v4.app.FragmentActivity; import android.support.v7.app.AlertDialog; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ViewHolder; @@ -515,7 +514,7 @@ public class CallLogAdapter extends GroupingListAdapter mBlockReportSpamListener = new BlockReportSpamListener( mActivity, - ((FragmentActivity) mActivity).getSupportFragmentManager(), + ((Activity) mActivity).getFragmentManager(), this, mFilteredNumberAsyncQueryHandler); setHasStableIds(true); diff --git a/java/com/android/dialer/app/calllog/CallLogFragment.java b/java/com/android/dialer/app/calllog/CallLogFragment.java index 49ed31e3f..aa765d90e 100644 --- a/java/com/android/dialer/app/calllog/CallLogFragment.java +++ b/java/com/android/dialer/app/calllog/CallLogFragment.java @@ -19,6 +19,7 @@ package com.android.dialer.app.calllog; import static android.Manifest.permission.READ_CALL_LOG; import android.app.Activity; +import android.app.Fragment; import android.app.KeyguardManager; import android.content.ContentResolver; import android.content.Context; @@ -33,7 +34,9 @@ import android.provider.CallLog.Calls; import android.provider.ContactsContract; import android.support.annotation.CallSuper; import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; +import android.support.v13.app.FragmentCompat; +import android.support.v13.app.FragmentCompat.OnRequestPermissionsResultCallback; +import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -77,6 +80,7 @@ public class CallLogFragment extends Fragment CallFetcher, MultiSelectRemoveView, OnEmptyViewActionButtonClickedListener, + OnRequestPermissionsResultCallback, CallLogModalAlertManager.Listener, OnClickListener { private static final String KEY_FILTER_TYPE = "filter_type"; @@ -302,21 +306,21 @@ public class CallLogFragment extends Fragment } protected void setupView(View view) { - mRecyclerView = view.findViewById(R.id.recycler_view); + mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view); mRecyclerView.setHasFixedSize(true); mLayoutManager = new LinearLayoutManager(getActivity()); mRecyclerView.setLayoutManager(mLayoutManager); PerformanceReport.logOnScrollStateChange(mRecyclerView); - mEmptyListView = view.findViewById(R.id.empty_list_view); + mEmptyListView = (EmptyContentView) view.findViewById(R.id.empty_list_view); mEmptyListView.setImage(R.drawable.empty_call_log); mEmptyListView.setActionClickedListener(this); - mModalAlertView = view.findViewById(R.id.modal_message_container); + mModalAlertView = (ViewGroup) view.findViewById(R.id.modal_message_container); mModalAlertManager = new CallLogModalAlertManager(LayoutInflater.from(getContext()), mModalAlertView, this); mMultiSelectUnSelectAllViewContent = view.findViewById(R.id.multi_select_select_all_view_content); - mSelectUnselectAllViewText = view.findViewById(R.id.select_all_view_text); - mSelectUnselectAllIcon = view.findViewById(R.id.select_all_view_icon); + mSelectUnselectAllViewText = (TextView) view.findViewById(R.id.select_all_view_text); + mSelectUnselectAllIcon = (ImageView) view.findViewById(R.id.select_all_view_icon); mMultiSelectUnSelectAllViewContent.setOnClickListener(null); mSelectUnselectAllIcon.setOnClickListener(this); mSelectUnselectAllViewText.setOnClickListener(this); @@ -331,7 +335,8 @@ public class CallLogFragment extends Fragment mContactInfoCache = new ContactInfoCache( - ExpirableCacheHeadlessFragment.attach(this).getRetainedCache(), + ExpirableCacheHeadlessFragment.attach((AppCompatActivity) getActivity()) + .getRetainedCache(), new ContactInfoHelper(getActivity(), currentCountryIso), mOnContactInfoChangedListener); mAdapter = @@ -570,7 +575,7 @@ public class CallLogFragment extends Fragment LogUtil.i( "CallLogFragment.onEmptyViewActionButtonClicked", "Requesting permissions: " + Arrays.toString(deniedPermissions)); - requestPermissions(deniedPermissions, PHONE_PERMISSIONS_REQUEST_CODE); + FragmentCompat.requestPermissions(this, deniedPermissions, PHONE_PERMISSIONS_REQUEST_CODE); } else if (!mIsCallLogActivity) { // Show dialpad if we are not in the call log activity. ((HostInterface) activity).showDialpad(); diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 2e61848d2..27aa82577 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -30,7 +30,6 @@ import android.support.annotation.IntDef; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; -import android.support.v4.app.FragmentActivity; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.telecom.PhoneAccount; @@ -998,7 +997,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private void maybeShowBlockNumberMigrationDialog(BlockedNumbersMigrator.Listener listener) { if (!FilteredNumberCompat.maybeShowBlockNumberMigrationDialog( - mContext, ((FragmentActivity) mContext).getSupportFragmentManager(), listener)) { + mContext, ((Activity) mContext).getFragmentManager(), listener)) { listener.onComplete(); } } diff --git a/java/com/android/dialer/app/calllog/ClearCallLogDialog.java b/java/com/android/dialer/app/calllog/ClearCallLogDialog.java index c100fa0e0..5c3d4d9fa 100644 --- a/java/com/android/dialer/app/calllog/ClearCallLogDialog.java +++ b/java/com/android/dialer/app/calllog/ClearCallLogDialog.java @@ -19,6 +19,8 @@ package com.android.dialer.app.calllog; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; +import android.app.FragmentManager; import android.app.ProgressDialog; import android.content.ContentResolver; import android.content.Context; @@ -28,8 +30,6 @@ import android.os.AsyncTask; import android.os.Bundle; import android.provider.CallLog.Calls; import android.support.annotation.NonNull; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.FragmentManager; import com.android.dialer.app.R; import com.android.dialer.common.Assert; import com.android.dialer.phonenumbercache.CachedNumberLookupService; diff --git a/java/com/android/dialer/app/contactinfo/ExpirableCacheHeadlessFragment.java b/java/com/android/dialer/app/contactinfo/ExpirableCacheHeadlessFragment.java index c41339131..aed51b507 100644 --- a/java/com/android/dialer/app/contactinfo/ExpirableCacheHeadlessFragment.java +++ b/java/com/android/dialer/app/contactinfo/ExpirableCacheHeadlessFragment.java @@ -42,11 +42,6 @@ public class ExpirableCacheHeadlessFragment extends Fragment { } @NonNull - public static ExpirableCacheHeadlessFragment attach(@NonNull Fragment fragment) { - return attach(fragment.getChildFragmentManager()); - } - - @NonNull private static ExpirableCacheHeadlessFragment attach(FragmentManager fragmentManager) { ExpirableCacheHeadlessFragment fragment = (ExpirableCacheHeadlessFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG); diff --git a/java/com/android/dialer/app/dialpad/DialpadFragment.java b/java/com/android/dialer/app/dialpad/DialpadFragment.java index 3c49dba57..3cd3ac27c 100644 --- a/java/com/android/dialer/app/dialpad/DialpadFragment.java +++ b/java/com/android/dialer/app/dialpad/DialpadFragment.java @@ -20,6 +20,8 @@ import android.Manifest.permission; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; +import android.app.Fragment; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; @@ -42,8 +44,6 @@ import android.provider.Contacts.PhonesColumns; import android.provider.Settings; import android.support.annotation.VisibleForTesting; import android.support.design.widget.FloatingActionButton; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; diff --git a/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java b/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java index a849f6ab6..a0c8b18d3 100644 --- a/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java +++ b/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java @@ -16,10 +16,10 @@ package com.android.dialer.app.dialpad; +import android.content.AsyncTaskLoader; import android.content.Context; import android.database.Cursor; import android.database.MatrixCursor; -import android.support.v4.content.AsyncTaskLoader; import com.android.contacts.common.list.PhoneNumberListAdapter.PhoneQuery; import com.android.dialer.common.LogUtil; import com.android.dialer.database.Database; diff --git a/java/com/android/dialer/app/filterednumber/BlockedNumbersAdapter.java b/java/com/android/dialer/app/filterednumber/BlockedNumbersAdapter.java index 503b4c4ca..dbd4e868c 100644 --- a/java/com/android/dialer/app/filterednumber/BlockedNumbersAdapter.java +++ b/java/com/android/dialer/app/filterednumber/BlockedNumbersAdapter.java @@ -15,9 +15,9 @@ */ package com.android.dialer.app.filterednumber; +import android.app.FragmentManager; import android.content.Context; import android.database.Cursor; -import android.support.v4.app.FragmentManager; import android.telephony.PhoneNumberUtils; import android.view.View; import com.android.contacts.common.ContactPhotoManager; diff --git a/java/com/android/dialer/app/filterednumber/BlockedNumbersFragment.java b/java/com/android/dialer/app/filterednumber/BlockedNumbersFragment.java index cb56db842..f53a45840 100644 --- a/java/com/android/dialer/app/filterednumber/BlockedNumbersFragment.java +++ b/java/com/android/dialer/app/filterednumber/BlockedNumbersFragment.java @@ -15,15 +15,15 @@ */ package com.android.dialer.app.filterednumber; +import android.app.ListFragment; +import android.app.LoaderManager; import android.content.Context; +import android.content.CursorLoader; +import android.content.Loader; import android.database.Cursor; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.support.v4.app.ActivityCompat; -import android.support.v4.app.ListFragment; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.CursorLoader; -import android.support.v4.content.Loader; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; @@ -71,8 +71,8 @@ public class BlockedNumbersFragment extends ListFragment (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); getListView().addHeaderView(inflater.inflate(R.layout.blocked_number_header, null)); getListView().addFooterView(inflater.inflate(R.layout.blocked_number_footer, null)); - // replace the icon for add number with LetterTileDrawable(), so it will have identical style - ImageView addNumberIcon = getActivity().findViewById(R.id.add_number_icon); + //replace the icon for add number with LetterTileDrawable(), so it will have identical style + ImageView addNumberIcon = (ImageView) getActivity().findViewById(R.id.add_number_icon); LetterTileDrawable drawable = new LetterTileDrawable(getResources()); drawable.setLetter(ADD_BLOCKED_NUMBER_ICON_LETTER); drawable.setColor( @@ -83,11 +83,11 @@ public class BlockedNumbersFragment extends ListFragment if (mAdapter == null) { mAdapter = BlockedNumbersAdapter.newBlockedNumbersAdapter( - getContext(), getActivity().getSupportFragmentManager()); + getContext(), getActivity().getFragmentManager()); } setListAdapter(mAdapter); - blockedNumbersText = getListView().findViewById(R.id.blocked_number_text_view); + blockedNumbersText = (TextView) getListView().findViewById(R.id.blocked_number_text_view); migratePromoView = getListView().findViewById(R.id.migrate_promo); getListView().findViewById(R.id.migrate_promo_allow_button).setOnClickListener(this); mImportSettings = getListView().findViewById(R.id.import_settings); @@ -98,7 +98,7 @@ public class BlockedNumbersFragment extends ListFragment getListView().findViewById(R.id.view_numbers_button).setOnClickListener(this); getListView().findViewById(R.id.add_number_linear_layout).setOnClickListener(this); - footerText = getActivity().findViewById(R.id.blocked_number_footer_textview); + footerText = (TextView) getActivity().findViewById(R.id.blocked_number_footer_textview); mVoicemailEnabledChecker = new VisualVoicemailEnabledChecker(getContext(), this); mVoicemailEnabledChecker.asyncUpdate(); updateActiveVoicemailProvider(); diff --git a/java/com/android/dialer/app/filterednumber/BlockedNumbersSettingsActivity.java b/java/com/android/dialer/app/filterednumber/BlockedNumbersSettingsActivity.java index b944e6364..9310fcb22 100644 --- a/java/com/android/dialer/app/filterednumber/BlockedNumbersSettingsActivity.java +++ b/java/com/android/dialer/app/filterednumber/BlockedNumbersSettingsActivity.java @@ -46,12 +46,12 @@ public class BlockedNumbersSettingsActivity extends AppCompatActivity public void showManagementUi() { BlockedNumbersFragment fragment = (BlockedNumbersFragment) - getSupportFragmentManager().findFragmentByTag(TAG_BLOCKED_MANAGEMENT_FRAGMENT); + getFragmentManager().findFragmentByTag(TAG_BLOCKED_MANAGEMENT_FRAGMENT); if (fragment == null) { fragment = new BlockedNumbersFragment(); } - getSupportFragmentManager() + getFragmentManager() .beginTransaction() .replace(R.id.blocked_numbers_activity_container, fragment, TAG_BLOCKED_MANAGEMENT_FRAGMENT) .commit(); @@ -63,7 +63,7 @@ public class BlockedNumbersSettingsActivity extends AppCompatActivity public void showSearchUi() { BlockedListSearchFragment fragment = (BlockedListSearchFragment) - getSupportFragmentManager().findFragmentByTag(TAG_BLOCKED_SEARCH_FRAGMENT); + getFragmentManager().findFragmentByTag(TAG_BLOCKED_SEARCH_FRAGMENT); if (fragment == null) { fragment = new BlockedListSearchFragment(); fragment.setHasOptionsMenu(false); @@ -71,7 +71,7 @@ public class BlockedNumbersSettingsActivity extends AppCompatActivity fragment.setDirectorySearchEnabled(false); } - getSupportFragmentManager() + getFragmentManager() .beginTransaction() .replace(R.id.blocked_numbers_activity_container, fragment, TAG_BLOCKED_SEARCH_FRAGMENT) .addToBackStack(null) @@ -87,12 +87,12 @@ public class BlockedNumbersSettingsActivity extends AppCompatActivity public void showNumbersToImportPreviewUi() { ViewNumbersToImportFragment fragment = (ViewNumbersToImportFragment) - getSupportFragmentManager().findFragmentByTag(TAG_VIEW_NUMBERS_TO_IMPORT_FRAGMENT); + getFragmentManager().findFragmentByTag(TAG_VIEW_NUMBERS_TO_IMPORT_FRAGMENT); if (fragment == null) { fragment = new ViewNumbersToImportFragment(); } - getSupportFragmentManager() + getFragmentManager() .beginTransaction() .replace( R.id.blocked_numbers_activity_container, fragment, TAG_VIEW_NUMBERS_TO_IMPORT_FRAGMENT) @@ -112,8 +112,8 @@ public class BlockedNumbersSettingsActivity extends AppCompatActivity @Override public void onBackPressed() { // TODO: Achieve back navigation without overriding onBackPressed. - if (getSupportFragmentManager().getBackStackEntryCount() > 0) { - getSupportFragmentManager().popBackStack(); + if (getFragmentManager().getBackStackEntryCount() > 0) { + getFragmentManager().popBackStack(); } else { super.onBackPressed(); } diff --git a/java/com/android/dialer/app/filterednumber/NumbersAdapter.java b/java/com/android/dialer/app/filterednumber/NumbersAdapter.java index 800ea2314..d98395ec7 100644 --- a/java/com/android/dialer/app/filterednumber/NumbersAdapter.java +++ b/java/com/android/dialer/app/filterednumber/NumbersAdapter.java @@ -15,10 +15,10 @@ */ package com.android.dialer.app.filterednumber; +import android.app.FragmentManager; import android.content.Context; import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Phone; -import android.support.v4.app.FragmentManager; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; import android.text.TextUtils; @@ -57,9 +57,10 @@ public class NumbersAdapter extends SimpleCursorAdapter { } public void updateView(View view, String number, String countryIso) { - final TextView callerName = view.findViewById(R.id.caller_name); - final TextView callerNumber = view.findViewById(R.id.caller_number); - final QuickContactBadge quickContactBadge = view.findViewById(R.id.quick_contact_photo); + final TextView callerName = (TextView) view.findViewById(R.id.caller_name); + final TextView callerNumber = (TextView) view.findViewById(R.id.caller_number); + final QuickContactBadge quickContactBadge = + (QuickContactBadge) view.findViewById(R.id.quick_contact_photo); quickContactBadge.setOverlay(null); if (CompatUtils.hasPrioritizedMimeType()) { quickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE); diff --git a/java/com/android/dialer/app/filterednumber/ViewNumbersToImportAdapter.java b/java/com/android/dialer/app/filterednumber/ViewNumbersToImportAdapter.java index 45ea29ed3..313efb4d7 100644 --- a/java/com/android/dialer/app/filterednumber/ViewNumbersToImportAdapter.java +++ b/java/com/android/dialer/app/filterednumber/ViewNumbersToImportAdapter.java @@ -15,9 +15,9 @@ */ package com.android.dialer.app.filterednumber; +import android.app.FragmentManager; import android.content.Context; import android.database.Cursor; -import android.support.v4.app.FragmentManager; import android.view.View; import com.android.contacts.common.ContactPhotoManager; import com.android.dialer.app.R; diff --git a/java/com/android/dialer/app/filterednumber/ViewNumbersToImportFragment.java b/java/com/android/dialer/app/filterednumber/ViewNumbersToImportFragment.java index 6eca03b29..d45f61ed7 100644 --- a/java/com/android/dialer/app/filterednumber/ViewNumbersToImportFragment.java +++ b/java/com/android/dialer/app/filterednumber/ViewNumbersToImportFragment.java @@ -15,14 +15,14 @@ */ package com.android.dialer.app.filterednumber; +import android.app.ListFragment; +import android.app.LoaderManager; import android.content.Context; +import android.content.CursorLoader; +import android.content.Loader; import android.database.Cursor; import android.os.Bundle; import android.provider.ContactsContract.CommonDataKinds.Phone; -import android.support.v4.app.ListFragment; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.CursorLoader; -import android.support.v4.content.Loader; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; @@ -49,7 +49,7 @@ public class ViewNumbersToImportFragment extends ListFragment if (mAdapter == null) { mAdapter = ViewNumbersToImportAdapter.newViewNumbersToImportAdapter( - getContext(), getActivity().getSupportFragmentManager()); + getContext(), getActivity().getFragmentManager()); } setListAdapter(mAdapter); } diff --git a/java/com/android/dialer/app/list/AllContactsFragment.java b/java/com/android/dialer/app/list/AllContactsFragment.java index 19c24521a..32a99e795 100644 --- a/java/com/android/dialer/app/list/AllContactsFragment.java +++ b/java/com/android/dialer/app/list/AllContactsFragment.java @@ -22,12 +22,13 @@ import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import android.content.Loader; import android.content.pm.PackageManager; import android.database.Cursor; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.QuickContact; -import android.support.v4.content.Loader; +import android.support.v13.app.FragmentCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -50,7 +51,8 @@ import java.util.Arrays; /** Fragments to show all contacts with phone numbers. */ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryListAdapter> - implements OnEmptyViewActionButtonClickedListener { + implements OnEmptyViewActionButtonClickedListener, + FragmentCompat.OnRequestPermissionsResultCallback { private static final int READ_CONTACTS_PERMISSION_REQUEST_CODE = 1; @@ -180,7 +182,8 @@ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryLi LogUtil.i( "AllContactsFragment.onEmptyViewActionButtonClicked", "Requesting permissions: " + Arrays.toString(deniedPermissions)); - requestPermissions(deniedPermissions, READ_CONTACTS_PERMISSION_REQUEST_CODE); + FragmentCompat.requestPermissions( + this, deniedPermissions, READ_CONTACTS_PERMISSION_REQUEST_CODE); } else { // Add new contact DialerUtils.startActivityWithErrorToast( diff --git a/java/com/android/dialer/app/list/DialtactsPagerAdapter.java b/java/com/android/dialer/app/list/DialtactsPagerAdapter.java index 52519f8d1..822aa789f 100644 --- a/java/com/android/dialer/app/list/DialtactsPagerAdapter.java +++ b/java/com/android/dialer/app/list/DialtactsPagerAdapter.java @@ -16,11 +16,11 @@ package com.android.dialer.app.list; +import android.app.Fragment; +import android.app.FragmentManager; import android.content.Context; import android.support.annotation.IntDef; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; +import android.support.v13.app.FragmentPagerAdapter; import android.view.ViewGroup; import com.android.dialer.app.calllog.CallLogFragment; import com.android.dialer.app.calllog.VisualVoicemailCallLogFragment; diff --git a/java/com/android/dialer/app/list/ListsFragment.java b/java/com/android/dialer/app/list/ListsFragment.java index 8e9438573..3f03db1e8 100644 --- a/java/com/android/dialer/app/list/ListsFragment.java +++ b/java/com/android/dialer/app/list/ListsFragment.java @@ -22,6 +22,7 @@ import static com.android.dialer.app.list.DialtactsPagerAdapter.TAB_INDEX_HISTOR import static com.android.dialer.app.list.DialtactsPagerAdapter.TAB_INDEX_SPEED_DIAL; import static com.android.dialer.app.list.DialtactsPagerAdapter.TAB_INDEX_VOICEMAIL; +import android.app.Fragment; import android.content.SharedPreferences; import android.database.ContentObserver; import android.database.Cursor; @@ -30,7 +31,6 @@ import android.os.Handler; import android.os.Trace; import android.preference.PreferenceManager; import android.provider.VoicemailContract; -import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.view.LayoutInflater; import android.view.View; diff --git a/java/com/android/dialer/app/list/OldSpeedDialFragment.java b/java/com/android/dialer/app/list/OldSpeedDialFragment.java index 986c51cfd..05d017b28 100644 --- a/java/com/android/dialer/app/list/OldSpeedDialFragment.java +++ b/java/com/android/dialer/app/list/OldSpeedDialFragment.java @@ -21,16 +21,17 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.app.Activity; +import android.app.Fragment; +import android.app.LoaderManager; +import android.content.CursorLoader; +import android.content.Loader; import android.content.pm.PackageManager; import android.database.Cursor; import android.graphics.Rect; import android.net.Uri; import android.os.Bundle; import android.os.Trace; -import android.support.v4.app.Fragment; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.CursorLoader; -import android.support.v4.content.Loader; +import android.support.v13.app.FragmentCompat; import android.support.v4.util.LongSparseArray; import android.view.LayoutInflater; import android.view.View; @@ -61,7 +62,8 @@ import java.util.Arrays; public class OldSpeedDialFragment extends Fragment implements OnItemClickListener, PhoneFavoritesTileAdapter.OnDataSetChangedForAnimationListener, - EmptyContentView.OnEmptyViewActionButtonClickedListener { + EmptyContentView.OnEmptyViewActionButtonClickedListener, + FragmentCompat.OnRequestPermissionsResultCallback { private static final int READ_CONTACTS_PERMISSION_REQUEST_CODE = 1; @@ -409,7 +411,8 @@ public class OldSpeedDialFragment extends Fragment LogUtil.i( "OldSpeedDialFragment.onEmptyViewActionButtonClicked", "Requesting permissions: " + Arrays.toString(deniedPermissions)); - requestPermissions(deniedPermissions, READ_CONTACTS_PERMISSION_REQUEST_CODE); + FragmentCompat.requestPermissions( + this, deniedPermissions, READ_CONTACTS_PERMISSION_REQUEST_CODE); } else { // Switch tabs ((HostInterface) activity).showAllContactsTab(); diff --git a/java/com/android/dialer/app/list/RegularSearchFragment.java b/java/com/android/dialer/app/list/RegularSearchFragment.java index c45f78390..728948bfc 100644 --- a/java/com/android/dialer/app/list/RegularSearchFragment.java +++ b/java/com/android/dialer/app/list/RegularSearchFragment.java @@ -19,6 +19,7 @@ import static android.Manifest.permission.READ_CONTACTS; import android.app.Activity; import android.content.pm.PackageManager; +import android.support.v13.app.FragmentCompat; import android.view.LayoutInflater; import android.view.ViewGroup; import com.android.contacts.common.list.ContactEntryListAdapter; @@ -34,7 +35,8 @@ import com.android.dialer.widget.EmptyContentView.OnEmptyViewActionButtonClicked import java.util.Arrays; public class RegularSearchFragment extends SearchFragment - implements OnEmptyViewActionButtonClickedListener { + implements OnEmptyViewActionButtonClickedListener, + FragmentCompat.OnRequestPermissionsResultCallback { public static final int PERMISSION_REQUEST_CODE = 1; @@ -121,7 +123,7 @@ public class RegularSearchFragment extends SearchFragment LogUtil.i( "RegularSearchFragment.onEmptyViewActionButtonClicked", "Requesting permissions: " + Arrays.toString(deniedPermissions)); - requestPermissions(deniedPermissions, PERMISSION_REQUEST_CODE); + FragmentCompat.requestPermissions(this, deniedPermissions, PERMISSION_REQUEST_CODE); } } } diff --git a/java/com/android/dialer/app/list/SearchFragment.java b/java/com/android/dialer/app/list/SearchFragment.java index a8a7347ae..00a2708a1 100644 --- a/java/com/android/dialer/app/list/SearchFragment.java +++ b/java/com/android/dialer/app/list/SearchFragment.java @@ -19,10 +19,10 @@ import android.animation.Animator; import android.animation.AnimatorInflater; import android.animation.AnimatorListenerAdapter; import android.app.Activity; +import android.app.DialogFragment; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; -import android.support.v4.app.DialogFragment; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; diff --git a/java/com/android/dialer/app/list/SmartDialSearchFragment.java b/java/com/android/dialer/app/list/SmartDialSearchFragment.java index f2969cf57..2ebc06bc3 100644 --- a/java/com/android/dialer/app/list/SmartDialSearchFragment.java +++ b/java/com/android/dialer/app/list/SmartDialSearchFragment.java @@ -22,9 +22,10 @@ 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; -import android.support.v4.content.Loader; +import android.support.v13.app.FragmentCompat; import com.android.contacts.common.list.ContactEntryListAdapter; import com.android.dialer.app.R; import com.android.dialer.app.dialpad.SmartDialCursorLoader; @@ -37,7 +38,8 @@ import java.util.Arrays; /** Implements a fragment to load and display SmartDial search results. */ public class SmartDialSearchFragment extends SearchFragment - implements EmptyContentView.OnEmptyViewActionButtonClickedListener { + implements EmptyContentView.OnEmptyViewActionButtonClickedListener, + FragmentCompat.OnRequestPermissionsResultCallback { private static final int CALL_PHONE_PERMISSION_REQUEST_CODE = 1; @@ -134,7 +136,8 @@ public class SmartDialSearchFragment extends SearchFragment LogUtil.i( "SmartDialSearchFragment.onEmptyViewActionButtonClicked", "Requesting permissions: " + Arrays.toString(deniedPermissions)); - requestPermissions(deniedPermissions, CALL_PHONE_PERMISSION_REQUEST_CODE); + FragmentCompat.requestPermissions( + this, deniedPermissions, CALL_PHONE_PERMISSION_REQUEST_CODE); } } diff --git a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java index 856767c59..5c9bc01c2 100644 --- a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java +++ b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java @@ -37,7 +37,6 @@ import android.provider.VoicemailContract.Voicemails; import android.support.annotation.MainThread; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; -import android.support.v4.app.FragmentActivity; import android.support.v4.content.FileProvider; import android.text.TextUtils; import android.util.Pair; @@ -128,7 +127,7 @@ public class VoicemailPlaybackPresenter protected MediaPlayer mMediaPlayer; // Used to run async tasks that need to interact with the UI. protected AsyncTaskExecutor mAsyncTaskExecutor; - private FragmentActivity mActivity; + private Activity mActivity; private PlaybackView mView; private int mPosition; private boolean mIsPlaying; @@ -176,7 +175,7 @@ public class VoicemailPlaybackPresenter */ @MainThread public static VoicemailPlaybackPresenter getInstance( - FragmentActivity activity, Bundle savedInstanceState) { + Activity activity, Bundle savedInstanceState) { if (sInstance == null) { sInstance = new VoicemailPlaybackPresenter(activity); } @@ -194,7 +193,7 @@ public class VoicemailPlaybackPresenter /** Update variables which are activity-dependent or state-dependent. */ @MainThread - protected void init(FragmentActivity activity, Bundle savedInstanceState) { + protected void init(Activity activity, Bundle savedInstanceState) { Assert.isMainThread(); mActivity = activity; mContext = activity; @@ -221,7 +220,7 @@ public class VoicemailPlaybackPresenter } shareVoicemailExecutor = DialerExecutors.createUiTaskBuilder( - mActivity.getSupportFragmentManager(), "test", new ShareVoicemailWorker()) + mActivity.getFragmentManager(), "test", new ShareVoicemailWorker()) .onSuccess( output -> { if (output == null) { diff --git a/java/com/android/dialer/blocking/BlockNumberDialogFragment.java b/java/com/android/dialer/blocking/BlockNumberDialogFragment.java index 7fedf518c..7ef77c4b6 100644 --- a/java/com/android/dialer/blocking/BlockNumberDialogFragment.java +++ b/java/com/android/dialer/blocking/BlockNumberDialogFragment.java @@ -18,14 +18,14 @@ package com.android.dialer.blocking; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; +import android.app.FragmentManager; import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; import android.net.Uri; import android.os.Bundle; import android.support.design.widget.Snackbar; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.FragmentManager; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.view.View; diff --git a/java/com/android/dialer/blocking/BlockReportSpamDialogs.java b/java/com/android/dialer/blocking/BlockReportSpamDialogs.java index ed30344d7..b5f81fcc5 100644 --- a/java/com/android/dialer/blocking/BlockReportSpamDialogs.java +++ b/java/com/android/dialer/blocking/BlockReportSpamDialogs.java @@ -19,11 +19,11 @@ package com.android.dialer.blocking; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; @@ -99,7 +99,7 @@ public class BlockReportSpamDialogs { } /** Contains the common attributes between all block/unblock/report dialog fragments. */ - public static class CommonDialogsFragment extends DialogFragment { + private static class CommonDialogsFragment extends DialogFragment { /** The number to display in the dialog title. */ protected String mDisplayNumber; diff --git a/java/com/android/dialer/blocking/FilteredNumberCompat.java b/java/com/android/dialer/blocking/FilteredNumberCompat.java index 033f09c9f..e104c4f94 100644 --- a/java/com/android/dialer/blocking/FilteredNumberCompat.java +++ b/java/com/android/dialer/blocking/FilteredNumberCompat.java @@ -17,6 +17,7 @@ package com.android.dialer.blocking; import android.annotation.TargetApi; +import android.app.FragmentManager; import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; @@ -30,7 +31,6 @@ import android.provider.BlockedNumberContract; import android.provider.BlockedNumberContract.BlockedNumbers; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; -import android.support.v4.app.FragmentManager; import android.telecom.TelecomManager; import android.telephony.PhoneNumberUtils; import com.android.dialer.common.LogUtil; diff --git a/java/com/android/dialer/blocking/MigrateBlockedNumbersDialogFragment.java b/java/com/android/dialer/blocking/MigrateBlockedNumbersDialogFragment.java index 1bf9175f5..76e50b38e 100644 --- a/java/com/android/dialer/blocking/MigrateBlockedNumbersDialogFragment.java +++ b/java/com/android/dialer/blocking/MigrateBlockedNumbersDialogFragment.java @@ -18,10 +18,10 @@ package com.android.dialer.blocking; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; import android.content.DialogInterface; import android.content.DialogInterface.OnShowListener; import android.os.Bundle; -import android.support.v4.app.DialogFragment; import android.view.View; import com.android.dialer.blocking.BlockedNumbersMigrator.Listener; import java.util.Objects; diff --git a/java/com/android/dialer/callcomposer/CallComposerActivity.java b/java/com/android/dialer/callcomposer/CallComposerActivity.java index c22113fcc..0b4c20a55 100644 --- a/java/com/android/dialer/callcomposer/CallComposerActivity.java +++ b/java/com/android/dialer/callcomposer/CallComposerActivity.java @@ -333,7 +333,7 @@ public class CallComposerActivity extends AppCompatActivity // If the current data is not a copy, make one. if (!galleryComposerFragment.selectedDataIsCopy()) { DialerExecutors.createUiTaskBuilder( - getSupportFragmentManager(), + getFragmentManager(), "copyAndResizeImageToSend", new CopyAndResizeImageWorker(this.getApplicationContext())) .onSuccess( diff --git a/java/com/android/dialer/callcomposer/GalleryComposerFragment.java b/java/com/android/dialer/callcomposer/GalleryComposerFragment.java index eeeb2f6f8..01e067440 100644 --- a/java/com/android/dialer/callcomposer/GalleryComposerFragment.java +++ b/java/com/android/dialer/callcomposer/GalleryComposerFragment.java @@ -125,7 +125,7 @@ public class GalleryComposerFragment extends CallComposerFragment copyAndResizeImage = executorFactory .createUiTaskBuilder( - getChildFragmentManager(), + getActivity().getFragmentManager(), "copyAndResizeImage", new CopyAndResizeImageWorker(getActivity().getApplicationContext())) .onSuccess( diff --git a/java/com/android/dialer/calldetails/CallDetailsActivity.java b/java/com/android/dialer/calldetails/CallDetailsActivity.java index 07254e393..411006c46 100644 --- a/java/com/android/dialer/calldetails/CallDetailsActivity.java +++ b/java/com/android/dialer/calldetails/CallDetailsActivity.java @@ -143,7 +143,7 @@ public class CallDetailsActivity extends AppCompatActivity @Override public void reportCallId(String number) { - ReportDialogFragment.newInstance(number).show(getSupportFragmentManager(), null); + ReportDialogFragment.newInstance(number).show(getFragmentManager(), null); } @Override diff --git a/java/com/android/dialer/calldetails/ReportDialogFragment.java b/java/com/android/dialer/calldetails/ReportDialogFragment.java index 0f3c78e44..0861c9dbb 100644 --- a/java/com/android/dialer/calldetails/ReportDialogFragment.java +++ b/java/com/android/dialer/calldetails/ReportDialogFragment.java @@ -18,11 +18,11 @@ package com.android.dialer.calldetails; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; import android.support.v4.util.Pair; import android.view.LayoutInflater; import android.view.View; diff --git a/java/com/android/dialer/calllog/ui/NewCallLogFragment.java b/java/com/android/dialer/calllog/ui/NewCallLogFragment.java index cdd09a639..17fcf1939 100644 --- a/java/com/android/dialer/calllog/ui/NewCallLogFragment.java +++ b/java/com/android/dialer/calllog/ui/NewCallLogFragment.java @@ -15,12 +15,12 @@ */ package com.android.dialer.calllog.ui; +import android.app.Fragment; +import android.app.LoaderManager.LoaderCallbacks; +import android.content.CursorLoader; +import android.content.Loader; import android.database.Cursor; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.LoaderManager.LoaderCallbacks; -import android.support.v4.content.CursorLoader; -import android.support.v4.content.Loader; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -70,7 +70,7 @@ public final class NewCallLogFragment extends Fragment refreshAnnotatedCallLogTask = dialerExecutorFactory .createUiTaskBuilder( - getChildFragmentManager(), + getFragmentManager(), "NewCallLogFragment.refreshAnnotatedCallLog", component.getRefreshAnnotatedCallLogWorker()) .build(); diff --git a/java/com/android/dialer/common/concurrent/DefaultDialerExecutorFactory.java b/java/com/android/dialer/common/concurrent/DefaultDialerExecutorFactory.java index 5600abb47..82e517d9a 100644 --- a/java/com/android/dialer/common/concurrent/DefaultDialerExecutorFactory.java +++ b/java/com/android/dialer/common/concurrent/DefaultDialerExecutorFactory.java @@ -16,10 +16,10 @@ package com.android.dialer.common.concurrent; +import android.app.FragmentManager; import android.os.AsyncTask; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.v4.app.FragmentManager; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutor.Builder; diff --git a/java/com/android/dialer/common/concurrent/DialerExecutorFactory.java b/java/com/android/dialer/common/concurrent/DialerExecutorFactory.java index 6a99fb0b2..82f8c7c3d 100644 --- a/java/com/android/dialer/common/concurrent/DialerExecutorFactory.java +++ b/java/com/android/dialer/common/concurrent/DialerExecutorFactory.java @@ -16,8 +16,8 @@ package com.android.dialer.common.concurrent; +import android.app.FragmentManager; import android.support.annotation.NonNull; -import android.support.v4.app.FragmentManager; import com.android.dialer.common.concurrent.DialerExecutor.Worker; /** @@ -31,10 +31,8 @@ import com.android.dialer.common.concurrent.DialerExecutor.Worker; public interface DialerExecutorFactory { /** - * Must be called from onCreate of your Activity or Fragment. + * Must be called from onCreate of your activity or fragment. * - * @param fragmentManager the FragmentManager owned by your Activity or Fragment (i.e. not the - * FragmentManager that contains your Fragment) * @param taskId used for the headless fragment ID and task ID * @param worker a function executed on a worker thread which accepts an {@link InputT} and * returns an {@link OutputT}. It should ideally not be an inner class of your (meaning it diff --git a/java/com/android/dialer/common/concurrent/DialerExecutors.java b/java/com/android/dialer/common/concurrent/DialerExecutors.java index f1764c2a4..148d8660c 100644 --- a/java/com/android/dialer/common/concurrent/DialerExecutors.java +++ b/java/com/android/dialer/common/concurrent/DialerExecutors.java @@ -16,8 +16,8 @@ package com.android.dialer.common.concurrent; +import android.app.FragmentManager; import android.support.annotation.NonNull; -import android.support.v4.app.FragmentManager; import com.android.dialer.common.Assert; import com.android.dialer.common.concurrent.DialerExecutor.Worker; diff --git a/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java b/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java index 300b39467..7f2a5a06b 100644 --- a/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java +++ b/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java @@ -16,13 +16,13 @@ package com.android.dialer.common.concurrent; +import android.app.Fragment; +import android.app.FragmentManager; import android.os.Bundle; import android.support.annotation.MainThread; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.WorkerThread; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutor.FailureListener; diff --git a/java/com/android/dialer/contactsfragment/ContactsCursorLoader.java b/java/com/android/dialer/contactsfragment/ContactsCursorLoader.java index 6ea66f7ef..a22f7eb39 100644 --- a/java/com/android/dialer/contactsfragment/ContactsCursorLoader.java +++ b/java/com/android/dialer/contactsfragment/ContactsCursorLoader.java @@ -17,8 +17,8 @@ package com.android.dialer.contactsfragment; import android.content.Context; +import android.content.CursorLoader; import android.provider.ContactsContract.Contacts; -import android.support.v4.content.CursorLoader; /** Cursor Loader for {@link ContactsFragment}. */ final class ContactsCursorLoader extends CursorLoader { diff --git a/java/com/android/dialer/contactsfragment/ContactsFragment.java b/java/com/android/dialer/contactsfragment/ContactsFragment.java index 1f214223f..e62771837 100644 --- a/java/com/android/dialer/contactsfragment/ContactsFragment.java +++ b/java/com/android/dialer/contactsfragment/ContactsFragment.java @@ -16,14 +16,15 @@ package com.android.dialer.contactsfragment; +import android.app.Fragment; +import android.app.LoaderManager.LoaderCallbacks; +import android.content.Loader; import android.content.pm.PackageManager; import android.database.Cursor; import android.os.Bundle; import android.provider.ContactsContract.Contacts; import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.LoaderManager.LoaderCallbacks; -import android.support.v4.content.Loader; +import android.support.v13.app.FragmentCompat; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.Recycler; @@ -205,7 +206,8 @@ public class ContactsFragment extends Fragment LogUtil.i( "ContactsFragment.onEmptyViewActionButtonClicked", "Requesting permissions: " + Arrays.toString(deniedPermissions)); - requestPermissions(deniedPermissions, READ_CONTACTS_PERMISSION_REQUEST_CODE); + FragmentCompat.requestPermissions( + this, deniedPermissions, READ_CONTACTS_PERMISSION_REQUEST_CODE); } } else if (emptyContentView.getActionLabel() diff --git a/java/com/android/dialer/interactions/PhoneNumberInteraction.java b/java/com/android/dialer/interactions/PhoneNumberInteraction.java index ea7d841f5..ef468a9f3 100644 --- a/java/com/android/dialer/interactions/PhoneNumberInteraction.java +++ b/java/com/android/dialer/interactions/PhoneNumberInteraction.java @@ -20,9 +20,14 @@ import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; +import android.app.DialogFragment; +import android.app.FragmentManager; import android.content.Context; +import android.content.CursorLoader; import android.content.DialogInterface; import android.content.Intent; +import android.content.Loader; +import android.content.Loader.OnLoadCompleteListener; import android.content.pm.PackageManager; import android.database.Cursor; import android.net.Uri; @@ -37,13 +42,7 @@ import android.provider.ContactsContract.RawContacts; import android.support.annotation.IntDef; import android.support.annotation.VisibleForTesting; import android.support.v4.app.ActivityCompat; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; import android.support.v4.content.ContextCompat; -import android.support.v4.content.CursorLoader; -import android.support.v4.content.Loader; -import android.support.v4.content.Loader.OnLoadCompleteListener; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -351,7 +350,7 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener<Cursor> { } private void showDisambiguationDialog(ArrayList<PhoneItem> phoneList) { - final FragmentActivity activity = (FragmentActivity) mContext; + final Activity activity = (Activity) mContext; if (activity.isDestroyed()) { // Check whether the activity is still running LogUtil.i("PhoneNumberInteraction.showDisambiguationDialog", "activity destroyed"); @@ -359,7 +358,7 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener<Cursor> { } try { PhoneDisambiguationDialogFragment.show( - activity.getSupportFragmentManager(), + activity.getFragmentManager(), phoneList, mInteractionType, mIsVideoCall, diff --git a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java index f50bb46ef..c72f28b25 100644 --- a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java @@ -17,9 +17,9 @@ package com.android.dialer.searchfragment.cp2; import android.content.Context; +import android.content.CursorLoader; import android.database.Cursor; import android.provider.ContactsContract.CommonDataKinds.Phone; -import android.support.v4.content.CursorLoader; import com.android.dialer.searchfragment.common.Projections; /** Cursor Loader for CP2 contacts. */ diff --git a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java index 561bcf9e3..d20bb1f8c 100644 --- a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java +++ b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java @@ -16,12 +16,12 @@ package com.android.dialer.searchfragment.list; +import android.app.Fragment; +import android.app.LoaderManager.LoaderCallbacks; +import android.content.Loader; import android.database.Cursor; import android.os.Bundle; import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.LoaderManager.LoaderCallbacks; -import android.support.v4.content.Loader; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; diff --git a/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java b/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java index 6b869608f..9f3193e92 100644 --- a/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java +++ b/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java @@ -17,9 +17,9 @@ package com.android.dialer.searchfragment.nearbyplaces; import android.content.Context; +import android.content.CursorLoader; import android.net.Uri; import android.provider.ContactsContract; -import android.support.v4.content.CursorLoader; import com.android.contacts.common.extensions.PhoneDirectoryExtenderAccessor; import com.android.dialer.searchfragment.common.Projections; diff --git a/java/com/android/dialer/speeddial/SpeedDialFragment.java b/java/com/android/dialer/speeddial/SpeedDialFragment.java index c9252f566..c087439eb 100644 --- a/java/com/android/dialer/speeddial/SpeedDialFragment.java +++ b/java/com/android/dialer/speeddial/SpeedDialFragment.java @@ -16,9 +16,9 @@ package com.android.dialer.speeddial; +import android.app.Fragment; import android.os.Bundle; import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index 435493696..4b0a3cd05 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -226,9 +226,7 @@ public class InCallActivityCommon { SelectPhoneAccountDialogFragment dialogFragment = (SelectPhoneAccountDialogFragment) - inCallActivity - .getSupportFragmentManager() - .findFragmentByTag(TAG_SELECT_ACCOUNT_FRAGMENT); + inCallActivity.getFragmentManager().findFragmentByTag(TAG_SELECT_ACCOUNT_FRAGMENT); if (dialogFragment != null) { dialogFragment.setListener(selectAccountListener); } @@ -886,7 +884,7 @@ public class InCallActivityCommon { selectAccountListener, waitingForAccountCall.getId()); selectPhoneAccountDialogFragment.show( - inCallActivity.getSupportFragmentManager(), TAG_SELECT_ACCOUNT_FRAGMENT); + inCallActivity.getFragmentManager(), TAG_SELECT_ACCOUNT_FRAGMENT); return true; } } diff --git a/java/com/android/incallui/spam/SpamNotificationActivity.java b/java/com/android/incallui/spam/SpamNotificationActivity.java index 2b8687d2c..ece0e4931 100644 --- a/java/com/android/incallui/spam/SpamNotificationActivity.java +++ b/java/com/android/incallui/spam/SpamNotificationActivity.java @@ -197,7 +197,7 @@ public class SpamNotificationActivity extends FragmentActivity { } }, dismissListener) - .show(getSupportFragmentManager(), BlockReportSpamDialogs.NOT_SPAM_DIALOG_TAG); + .show(getFragmentManager(), BlockReportSpamDialogs.NOT_SPAM_DIALOG_TAG); } else { reportNotSpamAndFinish(number, contactLookupResultType); } @@ -222,9 +222,7 @@ public class SpamNotificationActivity extends FragmentActivity { } }, dismissListener) - .show( - getSupportFragmentManager(), - BlockReportSpamDialogs.BLOCK_REPORT_SPAM_DIALOG_TAG); + .show(getFragmentManager(), BlockReportSpamDialogs.BLOCK_REPORT_SPAM_DIALOG_TAG); } }); } else { @@ -254,7 +252,7 @@ public class SpamNotificationActivity extends FragmentActivity { /** Checks if the user has migrated to the new blocking and display a dialog if necessary. */ private void maybeShowBlockNumberMigrationDialog(BlockedNumbersMigrator.Listener listener) { if (!FilteredNumberCompat.maybeShowBlockNumberMigrationDialog( - this, getSupportFragmentManager(), listener)) { + this, getFragmentManager(), listener)) { listener.onComplete(); } } |