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

Commit d9956b1c authored by Andrey Yepin's avatar Andrey Yepin Committed by Android (Google) Code Review
Browse files

Merge "Destroy all profile list adapters" into main

parents 95bf2524 1f513aa2
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -32,3 +32,14 @@ flag {
  description: "Provides additional callbacks with information about user actions in ChooserResult"
  bug: "263474465"
}

flag {
  name: "fix_resolver_memory_leak"
  is_exported: true
  namespace: "intentresolver"
  description: "ResolverActivity memory leak (through the AppPredictor callback) fix"
  bug: "346671041"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+13 −3
Original line number Diff line number Diff line
@@ -1209,9 +1209,19 @@ public class ResolverActivity extends Activity implements
        if (!isChangingConfigurations() && mPickOptionRequest != null) {
            mPickOptionRequest.cancel();
        }
        if (mMultiProfilePagerAdapter != null
                && mMultiProfilePagerAdapter.getActiveListAdapter() != null) {
            mMultiProfilePagerAdapter.getActiveListAdapter().onDestroy();
        if (mMultiProfilePagerAdapter != null) {
            ResolverListAdapter activeAdapter =
                    mMultiProfilePagerAdapter.getActiveListAdapter();
            if (activeAdapter != null) {
                activeAdapter.onDestroy();
            }
            if (android.service.chooser.Flags.fixResolverMemoryLeak()) {
                ResolverListAdapter inactiveAdapter =
                        mMultiProfilePagerAdapter.getInactiveListAdapter();
                if (inactiveAdapter != null) {
                    inactiveAdapter.onDestroy();
                }
            }
        }
    }