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

Commit 38a97b78 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge changes from topic "register_future_dismissal" into tm-dev

* changes:
  Remove the ActivityLaunchAnimCoordinator.
  Fix NotificationEntry mismatch crashes when tapping notification.
  Fix events so that VisualStabilityCoordinator blocks shade recalculation during activity launch animation
  Add logging required to diagnose the multi-entry issues
parents 6ff8ee2c 34b4ebd8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.systemui.statusbar.notification;

import android.content.Intent;
import android.service.notification.StatusBarNotification;
import android.view.View;

import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -29,7 +28,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
 */
public interface NotificationActivityStarter {
    /** Called when the user clicks on the surface of a notification. */
    void onNotificationClicked(StatusBarNotification sbn, ExpandableNotificationRow row);
    void onNotificationClicked(NotificationEntry entry, ExpandableNotificationRow row);

    /** Called when the user clicks on a button in the notification guts which fires an intent. */
    void startNotificationGutsIntent(Intent intent, int appUid,
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ public final class NotificationClicker implements View.OnClickListener {
            mBubblesOptional.get().collapseStack();
        }

        mNotificationActivityStarter.onNotificationClicked(entry.getSbn(), row);
        mNotificationActivityStarter.onNotificationClicked(entry, row);
    }

    private boolean isMenuVisible(ExpandableNotificationRow row) {
+5 −5
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ class NotificationClickerLogger @Inject constructor(
) {
    fun logOnClick(entry: NotificationEntry) {
        buffer.log(TAG, LogLevel.DEBUG, {
            str1 = entry.key
            str1 = entry.logKey
            str2 = entry.ranking.channel.id
        }, {
            "CLICK $str1 (channel=$str2)"
@@ -36,7 +36,7 @@ class NotificationClickerLogger @Inject constructor(

    fun logMenuVisible(entry: NotificationEntry) {
        buffer.log(TAG, LogLevel.DEBUG, {
            str1 = entry.key
            str1 = entry.logKey
        }, {
            "Ignoring click on $str1; menu is visible"
        })
@@ -44,7 +44,7 @@ class NotificationClickerLogger @Inject constructor(

    fun logParentMenuVisible(entry: NotificationEntry) {
        buffer.log(TAG, LogLevel.DEBUG, {
            str1 = entry.key
            str1 = entry.logKey
        }, {
            "Ignoring click on $str1; parent menu is visible"
        })
@@ -52,7 +52,7 @@ class NotificationClickerLogger @Inject constructor(

    fun logChildrenExpanded(entry: NotificationEntry) {
        buffer.log(TAG, LogLevel.DEBUG, {
            str1 = entry.key
            str1 = entry.logKey
        }, {
            "Ignoring click on $str1; children are expanded"
        })
@@ -60,7 +60,7 @@ class NotificationClickerLogger @Inject constructor(

    fun logGutsExposed(entry: NotificationEntry) {
        buffer.log(TAG, LogLevel.DEBUG, {
            str1 = entry.key
            str1 = entry.logKey
        }, {
            "Ignoring click on $str1; guts are exposed"
        })
+10 −3
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ import android.widget.ImageView;

import com.android.internal.util.ContrastColorUtil;
import com.android.systemui.R;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.ListEntry;
import com.android.systemui.util.Compile;

/**
 * A util class for various reusable functions
@@ -74,13 +75,19 @@ public class NotificationUtils {
        return (int) (dimensionPixelSize * factor);
    }

    private static final boolean INCLUDE_HASH_CODE_IN_LIST_ENTRY_LOG_KEY = false;

    /** Get the notification key, reformatted for logging, for the (optional) entry */
    public static String logKey(NotificationEntry entry) {
    public static String logKey(ListEntry entry) {
        if (entry == null) {
            return "null";
        }
        if (Compile.IS_DEBUG && INCLUDE_HASH_CODE_IN_LIST_ENTRY_LOG_KEY) {
            return logKey(entry.getKey()) + "@" + Integer.toHexString(entry.hashCode());
        } else {
            return logKey(entry.getKey());
        }
    }

    /** Removes newlines from the notification key to prettify apps that have these in the tag */
    public static String logKey(String key) {
+31 −0
Original line number Diff line number Diff line
@@ -11,20 +11,21 @@
 * 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.
 * limitations under the License
 */

package com.android.systemui.statusbar.phone;
package com.android.systemui.statusbar.notification

import com.android.systemui.dagger.SysUISingleton;
import android.service.notification.StatusBarNotification
import com.android.systemui.statusbar.notification.collection.ListEntry

import dagger.Binds;
import dagger.Module;
/** Get the notification key, reformatted for logging, for the (optional) entry  */
val ListEntry?.logKey: String?
    get() = this?.let { NotificationUtils.logKey(it) }

/** Provides a {@link NotifActivityLaunchEvents} in {@link SysUISingleton} scope. */
@Module
public abstract class NotifActivityLaunchEventsModule {
    @Binds
    abstract NotifActivityLaunchEvents bindLaunchEvents(
            StatusBarNotificationActivityStarter.LaunchEventsEmitter impl);
}
/** Get the notification key, reformatted for logging, for the (optional) sbn  */
val StatusBarNotification?.logKey: String?
    get() = this?.key?.let { NotificationUtils.logKey(it) }

/** Removes newlines from the notification key to prettify apps that have these in the tag  */
fun logKey(key: String?): String? = NotificationUtils.logKey(key)
 No newline at end of file
Loading