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

Commit c9d98884 authored by Raff Tsai's avatar Raff Tsai Committed by Android (Google) Code Review
Browse files

Merge "Fix no action in Settings storage"

parents 20cae52e a2e77a0e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ public class ManageApplications extends InstrumentedFragment
                mApplications.mHasReceivedBridgeCallback =
                        savedInstanceState.getBoolean(EXTRA_HAS_BRIDGE, false);
            }
            int userId = mIsWorkOnly ? mWorkUserId : UserHandle.getUserId(mCurrentUid);
            int userId = mIsWorkOnly ? mWorkUserId : UserHandle.myUserId();
            if (mStorageType == STORAGE_TYPE_MUSIC) {
                Context context = getContext();
                mApplications.setExtraViewController(
+1 −20
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static com.android.settings.dashboard.profileselector.ProfileSelectFragme
import static com.android.settings.dashboard.profileselector.ProfileSelectFragment.WORK_TAB;

import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
@@ -173,7 +172,7 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
        if (intent != null) {
            intent.putExtra(Intent.EXTRA_USER_ID, mUserId);

            launchIntent(intent);
            Utils.launchIntent(mFragment, intent);
            return true;
        }

@@ -467,24 +466,6 @@ public class StorageItemPreferenceController extends AbstractPreferenceControlle
        }
    }

    private void launchIntent(Intent intent) {
        try {
            final int userId = intent.getIntExtra(Intent.EXTRA_USER_ID, -1);

            // b/33117269: Note that launchIntent may launch activity in different task which set
            // different launchMode (e.g. Files), using startActivityForesult to set task as
            // source task, and set requestCode as 0 means don't care about returnCode currently.
            if (userId == -1) {
                mFragment.startActivityForResult(intent, 0 /* requestCode not used */);
            } else {
                mFragment.getActivity().startActivityForResultAsUser(intent,
                        0 /* requestCode not used */, new UserHandle(userId));
            }
        } catch (ActivityNotFoundException e) {
            Log.w(TAG, "No activity found for " + intent);
        }
    }

    private static long totalValues(StorageMeasurement.MeasurementDetails details, int userId,
            String... keys) {
        long total = 0;