Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d05c2a38 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Initialize ContactsUnavailableFragment in onAttachFragment

- This block of code was removed by mistake in ag/1452346.
- Here's the original history of the block:
  - ag/57051, ag/80412, ag/120732, ag/483115.

Bug: 31633212
Bug: 30944495

Test: manual
  - follow steps to repro in b/31633212.
  - follow steps in ag/1452346.

Change-Id: I90c60abd900e0edb2f941339fdb0fee3a3e7d9e5
parent 0981a588
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -197,6 +197,24 @@ public class PeopleActivity extends ContactsDrawerActivity implements ProviderSt
        return (mProviderStatus != null) && mProviderStatus.equals(ProviderStatus.STATUS_NORMAL);
    }

    /**
     * Initialize fragments that are (or may not be) in the layout.
     *
     * For the fragments that are in the layout, we initialize them in
     * {@link #createViewsAndFragments()} after inflating the layout.
     *
     * However, the {@link ContactsUnavailableFragment} is a special fragment which may not
     * be in the layout, so we have to do the initialization here.
     *
     * The ContactsUnavailableFragment is always created at runtime.
     */
    @Override
    public void onAttachFragment(Fragment fragment) {
        if (fragment instanceof ContactsUnavailableFragment) {
            mContactsUnavailableFragment = (ContactsUnavailableFragment)fragment;
        }
    }

    @Override
    protected void onCreate(Bundle savedState) {
        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {