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

Commit d578be27 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Activity selections not always persisted by AcitivtyChooserView."

parents 526ebf9b 8dbace2d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -317,6 +317,7 @@ public class ActivityChooserModel extends DataSetObservable {
                dataModel = new ActivityChooserModel(context, historyFileName);
                sDataModelRegistry.put(historyFileName, dataModel);
            }
            dataModel.readHistoricalData();
            return dataModel;
        }
    }
@@ -505,7 +506,7 @@ public class ActivityChooserModel extends DataSetObservable {
     *       data is read until this method is invoked.
     * <p>
     */
    public void readHistoricalData() {
    private void readHistoricalData() {
        synchronized (mInstanceLock) {
            if (!mCanReadHistoricalData || !mHistoricalRecordsChanged) {
                return;
@@ -527,7 +528,7 @@ public class ActivityChooserModel extends DataSetObservable {
     * @throws IllegalStateException If this method is called before a call to
     *         {@link #readHistoricalData()}.
     */
    public void persistHistoricalData() {
    private void persistHistoricalData() {
        synchronized (mInstanceLock) {
            if (!mReadShareHistoryCalled) {
                throw new IllegalStateException("No preceding call to #readHistoricalData");
@@ -629,6 +630,7 @@ public class ActivityChooserModel extends DataSetObservable {
            if (added) {
                mHistoricalRecordsChanged = true;
                pruneExcessiveHistoricalRecordsLocked();
                persistHistoricalData();
                sortActivities();
            }
            return added;
+0 −2
Original line number Diff line number Diff line
@@ -307,7 +307,6 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
        ActivityChooserModel dataModel = mAdapter.getDataModel();
        if (dataModel != null) {
            dataModel.registerObserver(mModelDataSetOberver);
            dataModel.readHistoricalData();
        }
        mIsAttachedToWindow = true;
    }
@@ -318,7 +317,6 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
        ActivityChooserModel dataModel = mAdapter.getDataModel();
        if (dataModel != null) {
            dataModel.unregisterObserver(mModelDataSetOberver);
            dataModel.persistHistoricalData();
        }
        mIsAttachedToWindow = false;
    }