Loading perf-tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ android_test { static_libs: [ "androidx.legacy_legacy-support-v4", "androidx.test.rules", "androidx.test.espresso.core", "mockito-target", "ub-janktesthelper", Loading res/values/styles.xml +6 −0 Original line number Diff line number Diff line Loading @@ -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> Loading src/com/android/documentsui/AbstractActionHandler.java +8 −2 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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( Loading src/com/android/documentsui/CreateDirectoryFragment.java +0 −1 Original line number Diff line number Diff line Loading @@ -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()); Loading src/com/android/documentsui/DirectoryLoader.java +0 −28 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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
perf-tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ android_test { static_libs: [ "androidx.legacy_legacy-support-v4", "androidx.test.rules", "androidx.test.espresso.core", "mockito-target", "ub-janktesthelper", Loading
res/values/styles.xml +6 −0 Original line number Diff line number Diff line Loading @@ -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> Loading
src/com/android/documentsui/AbstractActionHandler.java +8 −2 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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( Loading
src/com/android/documentsui/CreateDirectoryFragment.java +0 −1 Original line number Diff line number Diff line Loading @@ -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()); Loading
src/com/android/documentsui/DirectoryLoader.java +0 −28 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } }