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

Commit 05bce116 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5860054 from a350a769 to qt-qpr1-release

Change-Id: Ic3d6001122cb1a1f5aa9225adc601185403cdc75
parents 7607abde a350a769
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ android_test {

    static_libs: [
        "androidx.legacy_legacy-support-v4",
        "androidx.test.rules",
        "androidx.test.espresso.core",
        "mockito-target",
        "ub-janktesthelper",
+6 −0
Original line number Diff line number Diff line
@@ -91,8 +91,14 @@
        <item name="buttonBarNegativeButtonStyle">@style/DialogTextButton</item>
    </style>

    <style name="MaterialAlertDialogStyle" parent="@style/MaterialAlertDialog.MaterialComponents">
        <item name="backgroundInsetTop">12dp</item>
        <item name="backgroundInsetBottom">12dp</item>
    </style>

    <style name="MaterialAlertDialogTheme" parent="@style/ThemeOverlay.MaterialComponents.MaterialAlertDialog.Centered">
        <item name="android:dialogCornerRadius">@dimen/grid_item_radius</item>
        <item name="alertDialogStyle">@style/MaterialAlertDialogStyle</item>
        <item name="buttonBarPositiveButtonStyle">@style/DialogTextButton</item>
        <item name="buttonBarNegativeButtonStyle">@style/DialogTextButton</item>
        <item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialogTitleStyle</item>
+8 −2
Original line number Diff line number Diff line
@@ -576,11 +576,15 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA
            Context context = mActivity;

            if (mState.stack.isRecents()) {
                final LockingContentObserver observer = new LockingContentObserver(
                        mContentLock, AbstractActionHandler.this::loadDocumentsForCurrentStack);
                MultiRootDocumentsLoader loader;

                if (mSearchMgr.isSearching()) {
                    if (DEBUG) {
                        Log.d(TAG, "Creating new GlobalSearchLoader.");
                    }
                    return new GlobalSearchLoader(
                    loader = new GlobalSearchLoader(
                            context,
                            mProviders,
                            mState,
@@ -591,13 +595,15 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA
                    if (DEBUG) {
                        Log.d(TAG, "Creating new loader recents.");
                    }
                    return new RecentsLoader(
                    loader =  new RecentsLoader(
                            context,
                            mProviders,
                            mState,
                            mExecutors,
                            mInjector.fileTypeLookup);
                }
                loader.setObserver(observer);
                return loader;
            } else {
                Uri contentsUri = mSearchMgr.isSearching()
                        ? DocumentsContract.buildSearchDocumentsUri(
+0 −1
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@ public class CreateDirectoryFragment extends DialogFragment {
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        final Context context = getActivity();
        final ContentResolver resolver = context.getContentResolver();

        final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
        final LayoutInflater dialogInflater = LayoutInflater.from(builder.getContext());
+0 −28
Original line number Diff line number Diff line
@@ -16,20 +16,16 @@

package com.android.documentsui;

import static com.android.documentsui.base.SharedMinimal.DEBUG;
import static com.android.documentsui.base.SharedMinimal.VERBOSE;

import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.FileUtils;
import android.os.Handler;
import android.os.Looper;
import android.os.OperationCanceledException;
import android.os.RemoteException;
import android.provider.DocumentsContract.Document;
@@ -241,28 +237,4 @@ public class DirectoryLoader extends AsyncTaskLoader<DirectoryResult> {

        getContext().getContentResolver().unregisterContentObserver(mObserver);
    }

    private static final class LockingContentObserver extends ContentObserver {
        private final ContentLock mLock;
        private final Runnable mContentChangedCallback;

        public LockingContentObserver(ContentLock lock, Runnable contentChangedCallback) {
            super(new Handler(Looper.getMainLooper()));
            mLock = lock;
            mContentChangedCallback = contentChangedCallback;
        }

        @Override
        public boolean deliverSelfNotifications() {
            return true;
        }

        @Override
        public void onChange(boolean selfChange) {
            if (DEBUG) {
                Log.d(TAG, "Directory content updated.");
            }
            mLock.runWhenUnlocked(mContentChangedCallback);
        }
    }
}
Loading