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

Commit 49264666 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Eliminates NotificationEntryManager.getNotificationLongClicker()."

parents 7e59a7d4 59ec2ff4
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -20,11 +20,9 @@ import android.content.Context;

import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.car.CarNotificationEntryManager;
import com.android.systemui.car.CarNotificationInterruptionStateProvider;
import com.android.systemui.statusbar.car.CarFacetButtonController;
import com.android.systemui.statusbar.car.CarStatusBarKeyguardViewManager;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.volume.CarVolumeDialogComponent;
@@ -64,17 +62,17 @@ public class CarSystemUIFactory extends SystemUIFactory {
        return new CarVolumeDialogComponent(systemUi, context);
    }

    @Override
    public NotificationEntryManager provideNotificationEntryManager(Context context) {
        return new CarNotificationEntryManager(context);
    }

    @Override
    public NotificationInterruptionStateProvider provideNotificationInterruptionStateProvider(
            Context context) {
        return new CarNotificationInterruptionStateProvider(context);
    }

    @Override
    public boolean provideAllowNotificationLongPress() {
        return false;
    }

    @Module
    protected static class ContextHolder {
        private Context mContext;
+0 −41
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.car;

import android.content.Context;

import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;

public class CarNotificationEntryManager extends NotificationEntryManager {
    public CarNotificationEntryManager(Context context) {
        super(context);
    }

    /**
     * Returns the
     * {@link ExpandableNotificationRow.LongPressListener} that will
     * be triggered when a notification card is long-pressed.
     */
    @Override
    public ExpandableNotificationRow.LongPressListener getNotificationLongClicker() {
        // For the automative use case, we do not want to the user to be able to interact with
        // a notification other than a regular click. As a result, just return null for the
        // long click listener.
        return null;
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -156,6 +156,12 @@ public class Dependency extends SystemUI {
     */
    public static final String LEAK_REPORT_EMAIL_NAME = "leak_report_email";

    /**
     * Whether this platform supports long-pressing notifications to show notification channel
     * settings.
     */
    public static final String ALLOW_NOTIFICATION_LONG_PRESS_NAME = "allow_notif_longpress";

    /**
     * Key for getting a background Looper for background work.
     */
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui;

import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME;
import static com.android.systemui.Dependency.LEAK_REPORT_EMAIL_NAME;

import android.annotation.Nullable;
@@ -200,6 +201,13 @@ public class SystemUIFactory {
        return new NotificationInterruptionStateProvider(context);
    }

    @Singleton
    @Provides
    @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME)
    public boolean provideAllowNotificationLongPress() {
        return true;
    }

    @Module
    protected static class ContextHolder {
        private Context mContext;
+0 −5
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationUiAdjustment;
import com.android.systemui.statusbar.NotificationUpdateHandler;
import com.android.systemui.statusbar.notification.NotificationData.KeyguardEnvironment;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
import com.android.systemui.statusbar.notification.row.NotificationInflater;
import com.android.systemui.statusbar.notification.row.NotificationInflater.InflationFlag;
@@ -195,10 +194,6 @@ public class NotificationEntryManager implements
        return mPresenter;
    }

    public ExpandableNotificationRow.LongPressListener getNotificationLongClicker() {
        return getRowBinder().getNotificationLongClicker();
    }

    @Override
    public void onReorderingAllowed() {
        updateNotifications();
Loading