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

Commit 3a968cd4 authored by Garfield Tan's avatar Garfield Tan
Browse files

Use NotificationChannels.

Add a feature flag to prepare for cherry picking to ARC++.

Test: Manual tests & auto tests.
Bug: 37564296
Change-Id: I2294bd156aa3d484529526b472c608458d828e5c
parent fd784550
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
    <bool name="feature_gesture_scale">true</bool>
    <bool name="feature_job_progress_dialog">true</bool>
    <bool name="feature_launch_to_document">true</bool>
    <bool name="feature_notification_channel">true</bool>
    <bool name="feature_remote_actions">true</bool>
    <bool name="feature_system_keyboard_navigation">true</bool>
    <bool name="feature_virtual_files_sharing">true</bool>
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ public interface Features {
    boolean isGestureScaleEnabled();
    boolean isJobProgressDialogEnabled();
    boolean isLaunchToDocumentEnabled();
    boolean isNotificationChannelEnabled();
    boolean isRemoteActionsEnabled();
    boolean isSystemKeyboardNavigationEnabled();
    boolean isVirtualFilesSharingEnabled();
@@ -128,6 +129,11 @@ public interface Features {
            return isEnabled(R.bool.feature_launch_to_document);
        }

        @Override
        public boolean isNotificationChannelEnabled() {
            return isEnabled(R.bool.feature_notification_channel);
        }

        @Override
        public boolean isRemoteActionsEnabled() {
            return isEnabled(R.bool.feature_remote_actions);
+4 −3
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import com.android.documentsui.R;
import com.android.documentsui.archives.ArchivesProvider;
import com.android.documentsui.base.DocumentInfo;
import com.android.documentsui.base.DocumentStack;
import com.android.documentsui.base.Features;
import com.android.documentsui.clipping.UrisSupplier;

import java.io.FileNotFoundException;
@@ -55,9 +56,9 @@ final class CompressJob extends CopyJob {
     *
     * @see @link {@link Job} constructor for most param descriptions.
     */
    CompressJob(Context service, Listener listener,
            String id, DocumentStack destination, UrisSupplier srcs, Messenger messenger) {
        super(service, listener, id, OPERATION_MOVE, destination, srcs, messenger);
    CompressJob(Context service, Listener listener, String id, DocumentStack destination,
            UrisSupplier srcs, Messenger messenger, Features features) {
        super(service, listener, id, OPERATION_MOVE, destination, srcs, messenger, features);
    }

    @Override
+6 −5
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import com.android.documentsui.Metrics;
import com.android.documentsui.R;
import com.android.documentsui.base.DocumentInfo;
import com.android.documentsui.base.DocumentStack;
import com.android.documentsui.base.Features;
import com.android.documentsui.base.RootInfo;
import com.android.documentsui.clipping.UrisSupplier;
import com.android.documentsui.roots.ProvidersCache;
@@ -107,13 +108,13 @@ class CopyJob extends ResolvedResourcesJob {
     * @see @link {@link Job} constructor for most param descriptions.
     */
    CopyJob(Context service, Listener listener, String id, DocumentStack destination,
            UrisSupplier srcs, Messenger messenger) {
        this(service, listener, id, OPERATION_COPY, destination, srcs, messenger);
            UrisSupplier srcs, Messenger messenger, Features features) {
        this(service, listener, id, OPERATION_COPY, destination, srcs, messenger, features);
    }

    CopyJob(Context service, Listener listener, String id, @OpType int opType,
            DocumentStack destination, UrisSupplier srcs, Messenger messenger) {
        super(service, listener, id, opType, destination, srcs);
            DocumentStack destination, UrisSupplier srcs, Messenger messenger, Features features) {
        super(service, listener, id, opType, destination, srcs, features);
        mDstInfo = destination.peek();
        mMessenger = messenger;

@@ -222,7 +223,7 @@ class CopyJob extends ResolvedResourcesJob {

        // TODO: Consider adding a dialog on tapping the notification with a list of
        // converted files.
        final Notification.Builder warningBuilder = new Notification.Builder(service)
        final Notification.Builder warningBuilder = createNotificationBuilder()
                .setContentTitle(service.getResources().getString(
                        R.string.notification_copy_files_converted_title))
                .setContentText(service.getString(
+3 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.documentsui.Metrics;
import com.android.documentsui.R;
import com.android.documentsui.base.DocumentInfo;
import com.android.documentsui.base.DocumentStack;
import com.android.documentsui.base.Features;
import com.android.documentsui.clipping.UrisSupplier;

import java.io.FileNotFoundException;
@@ -51,8 +52,8 @@ final class DeleteJob extends ResolvedResourcesJob {
     * @see @link {@link Job} constructor for most param descriptions.
     */
    DeleteJob(Context service, Listener listener, String id, DocumentStack stack,
            UrisSupplier srcs, @Nullable Uri srcParent) {
        super(service, listener, id, OPERATION_DELETE, stack, srcs);
            UrisSupplier srcs, @Nullable Uri srcParent, Features features) {
        super(service, listener, id, OPERATION_DELETE, stack, srcs, features);
        mParentUri = srcParent;
    }

Loading