[Glic] Make notifications silent only if we are not in PiP or in CTA [chromium/src : main]

0 views
Skip to first unread message

Bhuvana Betini (Gerrit)

unread,
Apr 10, 2026, 7:57:46 PMApr 10
to Wenyu Fu, Ritika Gupta, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ritika Gupta and Wenyu Fu

Bhuvana Betini added 5 comments

Commit Message
Line 7, Patchset 2:[Glic] Make notifications silent Only if we are not in PiP or in CTA
Wenyu Fu . resolved

nit: %s/Only/only

Bhuvana Betini

Done

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactory.java
Line 117, Patchset 2: * @return True if ChromeTabbedActivity is currently visible (Resumed, Paused or Started).
Ritika Gupta . resolved

nit : and is in foreground.

Bhuvana Betini

Done

Line 124, Patchset 2: if (!activity.getClass()
.getName()
.equals("org.chromium.chrome.browser.ChromeTabbedActivity")) {
Wenyu Fu . unresolved

This is bad in a lot of reasons (e.g. unreliable, and multi-instances) :/

I also don't know if there's a good place to check this as a static method. I think we should make the caller of this method accept an activity object, and check if we should make this silence. Maybe having `isSilent` as a input to `buildNotification`. It will still require decent amount of wiring, though.

Bhuvana Betini

Addressed this by restructuring a bit

  • moved the visibility and silence logic out of the static ActorNotificationFactory and into a non-static implementation (ActorForegroundServiceControllerImpl).
  • uses TabModelSelectorSupplier to verify if the specific tabs associated with a task are actually present in the current activity instance to address multi-instance concerns
Line 124, Patchset 2: if (!activity.getClass()
.getName()
.equals("org.chromium.chrome.browser.ChromeTabbedActivity")) {
return false;
}
Ritika Gupta . resolved
nit : instanceof should be better here?
if (!(activity instanceof ChromeTabbedActivity)) {
return false;
}
Bhuvana Betini

Done

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactoryTest.java
Line 291, Patchset 2: public void testIsChromeTabbedActivityVisible_NoActivities() {
Ritika Gupta . resolved

Please fix failing test please.

Bhuvana Betini

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ritika Gupta
  • Wenyu Fu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
Gerrit-Change-Number: 7745681
Gerrit-PatchSet: 5
Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Ritika Gupta <riti...@google.com>
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Fri, 10 Apr 2026 23:57:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ritika Gupta <riti...@google.com>
Comment-In-Reply-To: Wenyu Fu <wen...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Wenyu Fu (Gerrit)

unread,
Apr 10, 2026, 8:39:13 PMApr 10
to Bhuvana Betini, Ritika Gupta, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Bhuvana Betini and Ritika Gupta

Wenyu Fu added 11 comments

File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
Line 129, Patchset 5 (Latest): for (Activity activity : ApplicationStatus.getRunningActivities()) {
Wenyu Fu . unresolved

This might be ok assuming we won't have too many activty, but I still don't like the fact we have to loop through all activities.

Any chance we can just use a `ActivityStateListener` here? https://source.chromium.org/chromium/chromium/src/+/main:base/android/java/src/org/chromium/base/ApplicationStatus.java;l=154?q=-file:%5Eout%2F%20-file:%5Ethird_party%2F%20ApplicationStatus&ss=chromium%2Fchromium%2Fsrc

Line 144, Patchset 5 (Latest): if (taskTabs.isEmpty()) {
Wenyu Fu . unresolved

This seems not needed to live in the loop?

Line 145, Patchset 5 (Latest): return true;
Wenyu Fu . unresolved

I'm not sure how to link `taskTabs.isEmpty()` with `isActivityVisibleForTask = true`... Is this an inexplicit assumption that if there's no tab associate with task, task is finishing, so we can make the notification silence?

File chrome/android/junit/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImplTest.java
Line 198, Patchset 5 (Latest): when(mChromeActivity.getTabModelSelector()).thenReturn(mTabModelSelector);
Wenyu Fu . unresolved

This line doesn't appear to do anything, as the implementation under test uses `TabModelSelectorSupplier.getValueOrNullFrom()`. The test works due to `TabModelSelectorSupplier.setInstanceForTesting()` in `setUp()`.

To avoid confusion, it might be best to remove this line (and the similar one in `testIsActivityVisibleForTask_WithTabs_NoSilenceWhenTabNotInActivity`).

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceManager.java
Line 144, Patchset 5 (Latest): boolean isSilent = task != null && mServiceController.isActivityVisibleForTask(task);
Wenyu Fu . unresolved

Need to think about this - if task is null, should we make it silent? Is `task == null` here a valid case?

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactory.java
Line 74, Patchset 5 (Latest): .setSilent(isSilent);
Wenyu Fu . unresolved

Sorry didn't flag in earlier review, but I think we should only make a subset of notification type non-silence.

ACTING / REFLECTING / PAUSED_BY_USER does not feel they should be non-silence; it is only the ones that needs user attention.

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
Line 110, Patchset 5 (Latest): if (notification != null && notification.isSilent() != isSilent) {
Wenyu Fu . unresolved

Im unsure about this... I think for a task, it's possible

Line 136, Patchset 5 (Latest): public @Nullable ActorTask getTask(int taskId) {
Wenyu Fu . unresolved

nit: Seems can be package private

Line 137, Patchset 5 (Latest): ActorTask task = mKeyedService.getTask(taskId);
Wenyu Fu . unresolved

Intuitively I thought we read from cache first before checking the service. Any reason we are going with the reverse order?

If it is indeed needed, a comment around would be helpful.

File components/browser_ui/notifications/android/java/src/org/chromium/components/browser_ui/notifications/NotificationWrapperStandardBuilder.java
Line 31, Patchset 5 (Latest):public class NotificationWrapperStandardBuilder implements NotificationWrapperBuilder {
Wenyu Fu . unresolved

In fact, I can't seem to find usage of this class, maybe we can remove it

Line 264, Patchset 5 (Latest): mIsSilent = silent;
Wenyu Fu . unresolved

Since it's not supported, we should remove this so mIsSilent is always false.

Open in Gerrit

Related details

Attention is currently required from:
  • Bhuvana Betini
  • Ritika Gupta
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
Gerrit-Change-Number: 7745681
Gerrit-PatchSet: 5
Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Bhuvana Betini <bbe...@google.com>
Gerrit-Attention: Ritika Gupta <riti...@google.com>
Gerrit-Comment-Date: Sat, 11 Apr 2026 00:38:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Bhuvana Betini (Gerrit)

unread,
Apr 14, 2026, 8:55:21 PMApr 14
to Wenyu Fu, Ritika Gupta, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ritika Gupta and Wenyu Fu

Bhuvana Betini added 11 comments

File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
Line 129, Patchset 5: for (Activity activity : ApplicationStatus.getRunningActivities()) {
Wenyu Fu . resolved

This might be ok assuming we won't have too many activty, but I still don't like the fact we have to loop through all activities.

Any chance we can just use a `ActivityStateListener` here? https://source.chromium.org/chromium/chromium/src/+/main:base/android/java/src/org/chromium/base/ApplicationStatus.java;l=154?q=-file:%5Eout%2F%20-file:%5Ethird_party%2F%20ApplicationStatus&ss=chromium%2Fchromium%2Fsrc

Bhuvana Betini

Done

Line 144, Patchset 5: if (taskTabs.isEmpty()) {
Wenyu Fu . resolved

This seems not needed to live in the loop?

Bhuvana Betini

Done

Wenyu Fu . unresolved

I'm not sure how to link `taskTabs.isEmpty()` with `isActivityVisibleForTask = true`... Is this an inexplicit assumption that if there's no tab associate with task, task is finishing, so we can make the notification silence?

Bhuvana Betini

Yes, I was finding this to be an issue with manual testing. It seems to create a race condition between taskTabs and the task itself when finishing.

File chrome/android/junit/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImplTest.java
Line 198, Patchset 5: when(mChromeActivity.getTabModelSelector()).thenReturn(mTabModelSelector);
Wenyu Fu . resolved

This line doesn't appear to do anything, as the implementation under test uses `TabModelSelectorSupplier.getValueOrNullFrom()`. The test works due to `TabModelSelectorSupplier.setInstanceForTesting()` in `setUp()`.

To avoid confusion, it might be best to remove this line (and the similar one in `testIsActivityVisibleForTask_WithTabs_NoSilenceWhenTabNotInActivity`).

Bhuvana Betini

Done

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceManager.java
Line 144, Patchset 5: boolean isSilent = task != null && mServiceController.isActivityVisibleForTask(task);
Wenyu Fu . unresolved

Need to think about this - if task is null, should we make it silent? Is `task == null` here a valid case?

Bhuvana Betini

If task is null, we still proceed to updateNotificationForTask because that method handles the 'safe cleanup' (cancelling the notification and clearing internal data structures) for tasks that are no longer found in native or the cache.

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactory.java
Line 74, Patchset 5: .setSilent(isSilent);
Wenyu Fu . resolved

Sorry didn't flag in earlier review, but I think we should only make a subset of notification type non-silence.

ACTING / REFLECTING / PAUSED_BY_USER does not feel they should be non-silence; it is only the ones that needs user attention.

Bhuvana Betini

Done

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
Line 110, Patchset 5: if (notification != null && notification.isSilent() != isSilent) {
Wenyu Fu . unresolved

Im unsure about this... I think for a task, it's possible

Bhuvana Betini

Sorry, can you clarify which part you mean?

Line 136, Patchset 5: public @Nullable ActorTask getTask(int taskId) {
Wenyu Fu . resolved

nit: Seems can be package private

Bhuvana Betini

Done

Line 137, Patchset 5: ActorTask task = mKeyedService.getTask(taskId);
Wenyu Fu . resolved

Intuitively I thought we read from cache first before checking the service. Any reason we are going with the reverse order?

If it is indeed needed, a comment around would be helpful.

Bhuvana Betini

Done

File components/browser_ui/notifications/android/java/src/org/chromium/components/browser_ui/notifications/NotificationWrapperStandardBuilder.java
Line 31, Patchset 5:public class NotificationWrapperStandardBuilder implements NotificationWrapperBuilder {
Wenyu Fu . resolved

In fact, I can't seem to find usage of this class, maybe we can remove it

Bhuvana Betini

Done

Line 264, Patchset 5: mIsSilent = silent;
Wenyu Fu . resolved

Since it's not supported, we should remove this so mIsSilent is always false.

Bhuvana Betini

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ritika Gupta
  • Wenyu Fu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
Gerrit-Change-Number: 7745681
Gerrit-PatchSet: 9
Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Ritika Gupta <riti...@google.com>
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Apr 2026 00:55:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Wenyu Fu <wen...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Wenyu Fu (Gerrit)

unread,
Apr 14, 2026, 10:40:27 PMApr 14
to Bhuvana Betini, Ritika Gupta, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Bhuvana Betini and Ritika Gupta

Wenyu Fu added 3 comments

File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
Line 71, Patchset 9 (Latest): this::onActivityStateChange);
Wenyu Fu . unresolved

nit: Use a member variable to store this. We need to remove it when service unbind.

Line 87, Patchset 9 (Latest): mVisibleActivities.add(asyncActivity);
Wenyu Fu . unresolved

This feels scary we are keeping a list of activity reference (which can very much cause memory leaks).

When this method is called, can we just update a boolean `shouldSilenceNotification(task, activity)`? (this means we store ActorTask in this class too - maybe we do that using a weak reference)

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
Line 110, Patchset 5: if (notification != null && notification.isSilent() != isSilent) {
Wenyu Fu . resolved

Im unsure about this... I think for a task, it's possible

Bhuvana Betini

Sorry, can you clarify which part you mean?

Wenyu Fu

Marked as resolved. I don't remember what I intend to say. Sorry for the churn

Open in Gerrit

Related details

Attention is currently required from:
  • Bhuvana Betini
  • Ritika Gupta
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
Gerrit-Change-Number: 7745681
Gerrit-PatchSet: 9
Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Bhuvana Betini <bbe...@google.com>
Gerrit-Attention: Ritika Gupta <riti...@google.com>
Gerrit-Comment-Date: Wed, 15 Apr 2026 02:40:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Bhuvana Betini <bbe...@google.com>
Comment-In-Reply-To: Wenyu Fu <wen...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ritika Gupta (Gerrit)

unread,
Apr 15, 2026, 1:33:39 PMApr 15
to Bhuvana Betini, Wenyu Fu, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Bhuvana Betini

Ritika Gupta added 4 comments

File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
Line 67, Patchset 9 (Latest): public ActorForegroundServiceControllerImpl() {
Ritika Gupta . unresolved

Why do we need to keep track of all the activities here? I dont think we should keep track of all the activities.

Line 81, Patchset 9 (Latest): if (!(activity instanceof AsyncInitializationActivity asyncActivity)) return;
Ritika Gupta . unresolved

Does this need to be AsyncInitializationActivity, can we check ChromeTabbedActivity here? @wen...@chromium.org

Wenyu Fu . unresolved

I'm not sure how to link `taskTabs.isEmpty()` with `isActivityVisibleForTask = true`... Is this an inexplicit assumption that if there's no tab associate with task, task is finishing, so we can make the notification silence?

Bhuvana Betini

Yes, I was finding this to be an issue with manual testing. It seems to create a race condition between taskTabs and the task itself when finishing.

Ritika Gupta

We figured out yesterday that as soon as task is completed/finished all the tabs related to actor task are cleaned up.

Line 155, Patchset 9 (Latest): public boolean isActivityVisibleForTask(ActorTask task) {
ThreadUtils.assertOnUiThread();
Set<Integer> taskTabs = task.getTabs();
boolean hasVisibleActivityNotInPip = false;
for (AsyncInitializationActivity asyncActivity : mVisibleActivities) {
if (asyncActivity.isInPictureInPictureMode()) continue;
hasVisibleActivityNotInPip = true;
if (!taskTabs.isEmpty()) {
TabModelSelector selector =
TabModelSelectorSupplier.getValueOrNullFrom(
asyncActivity.getWindowAndroid());
if (selector != null) {
for (int tabId : taskTabs) {
if (selector.getTabById(tabId) != null) return true;
}
}
}
}
return taskTabs.isEmpty() && hasVisibleActivityNotInPip;
}
Ritika Gupta . unresolved

I think all we are trying to do here is that we are not in any of the tabs related to task.

I think all we should do in this class should be : Check if the current activity is an instance of CTA and if check if selector has tabs related to actor.

Open in Gerrit

Related details

Attention is currently required from:
  • Bhuvana Betini
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
Gerrit-Change-Number: 7745681
Gerrit-PatchSet: 9
Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Bhuvana Betini <bbe...@google.com>
Gerrit-Comment-Date: Wed, 15 Apr 2026 17:33:28 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Bhuvana Betini (Gerrit)

unread,
Apr 15, 2026, 6:30:35 PMApr 15
to Wenyu Fu, Ritika Gupta, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ritika Gupta and Wenyu Fu

Bhuvana Betini added 5 comments

File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
Line 67, Patchset 9: public ActorForegroundServiceControllerImpl() {
Ritika Gupta . resolved

Why do we need to keep track of all the activities here? I dont think we should keep track of all the activities.

Bhuvana Betini

Acknowledged

Line 71, Patchset 9: this::onActivityStateChange);
Wenyu Fu . resolved

nit: Use a member variable to store this. We need to remove it when service unbind.

Bhuvana Betini

Implemented fix Ritika mentioned so this should no longer be relevant, I believe.

Line 81, Patchset 9: if (!(activity instanceof AsyncInitializationActivity asyncActivity)) return;
Ritika Gupta . unresolved

Does this need to be AsyncInitializationActivity, can we check ChromeTabbedActivity here? @wen...@chromium.org

Bhuvana Betini

CTA import is banned in chrome/android

Line 87, Patchset 9: mVisibleActivities.add(asyncActivity);
Wenyu Fu . resolved

This feels scary we are keeping a list of activity reference (which can very much cause memory leaks).

When this method is called, can we just update a boolean `shouldSilenceNotification(task, activity)`? (this means we store ActorTask in this class too - maybe we do that using a weak reference)

Bhuvana Betini

Implemented alternate fix :)

Line 155, Patchset 9: public boolean isActivityVisibleForTask(ActorTask task) {

ThreadUtils.assertOnUiThread();
Set<Integer> taskTabs = task.getTabs();
boolean hasVisibleActivityNotInPip = false;
for (AsyncInitializationActivity asyncActivity : mVisibleActivities) {
if (asyncActivity.isInPictureInPictureMode()) continue;
hasVisibleActivityNotInPip = true;
if (!taskTabs.isEmpty()) {
TabModelSelector selector =
TabModelSelectorSupplier.getValueOrNullFrom(
asyncActivity.getWindowAndroid());
if (selector != null) {
for (int tabId : taskTabs) {
if (selector.getTabById(tabId) != null) return true;
}
}
}
}
return taskTabs.isEmpty() && hasVisibleActivityNotInPip;
}
Ritika Gupta . resolved

I think all we are trying to do here is that we are not in any of the tabs related to task.

I think all we should do in this class should be : Check if the current activity is an instance of CTA and if check if selector has tabs related to actor.

Bhuvana Betini

Implemented this fix.

Open in Gerrit

Related details

Attention is currently required from:
  • Ritika Gupta
  • Wenyu Fu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
Gerrit-Change-Number: 7745681
Gerrit-PatchSet: 11
Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Ritika Gupta <riti...@google.com>
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Apr 2026 22:30:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Wenyu Fu (Gerrit)

unread,
Apr 15, 2026, 9:13:13 PMApr 15
to Bhuvana Betini, Ritika Gupta, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Bhuvana Betini and Ritika Gupta

Wenyu Fu voted and added 7 comments

Votes added by Wenyu Fu

Code-Review+1

7 comments

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Wenyu Fu . resolved

LGTM % nits

File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
Line 64, Patchset 11 (Latest): public ActorForegroundServiceControllerImpl() {}
Wenyu Fu . unresolved

nit: Seems redundant?

Line 133, Patchset 11 (Latest): // An activity is considered visible for a task if it is a ChromeTabbedActivity that is not
// in PiP. Since we cannot directly reference ChromeTabbedActivity, we use the
Wenyu Fu . resolved

I don't like that this method adds the assumption of PiP :/ Might be ok because this comment, but we might want to rename this to something else

Wenyu Fu . unresolved

I'm not sure how to link `taskTabs.isEmpty()` with `isActivityVisibleForTask = true`... Is this an inexplicit assumption that if there's no tab associate with task, task is finishing, so we can make the notification silence?

Bhuvana Betini

Yes, I was finding this to be an issue with manual testing. It seems to create a race condition between taskTabs and the task itself when finishing.

Ritika Gupta

We figured out yesterday that as soon as task is completed/finished all the tabs related to actor task are cleaned up.

Wenyu Fu

In this case, it means this is a new notification sent while task is done. Should we send a non-silent notifications?

Line 152, Patchset 11 (Latest): }
}
}
}
Wenyu Fu . unresolved

nit: Use early return to reduce indentation

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceManager.java
Line 144, Patchset 5: boolean isSilent = task != null && mServiceController.isActivityVisibleForTask(task);
Wenyu Fu . resolved

Need to think about this - if task is null, should we make it silent? Is `task == null` here a valid case?

Bhuvana Betini

If task is null, we still proceed to updateNotificationForTask because that method handles the 'safe cleanup' (cancelling the notification and clearing internal data structures) for tasks that are no longer found in native or the cache.

Wenyu Fu

Acknowledged- thanks!

File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactory.java
Line 124, Patchset 2: if (!activity.getClass()
.getName()
.equals("org.chromium.chrome.browser.ChromeTabbedActivity")) {
Wenyu Fu . resolved

This is bad in a lot of reasons (e.g. unreliable, and multi-instances) :/

I also don't know if there's a good place to check this as a static method. I think we should make the caller of this method accept an activity object, and check if we should make this silence. Maybe having `isSilent` as a input to `buildNotification`. It will still require decent amount of wiring, though.

Bhuvana Betini

Addressed this by restructuring a bit

  • moved the visibility and silence logic out of the static ActorNotificationFactory and into a non-static implementation (ActorForegroundServiceControllerImpl).
  • uses TabModelSelectorSupplier to verify if the specific tabs associated with a task are actually present in the current activity instance to address multi-instance concerns
Wenyu Fu

Looks good now!

Open in Gerrit

Related details

Attention is currently required from:
  • Bhuvana Betini
  • Ritika Gupta
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
Gerrit-Change-Number: 7745681
Gerrit-PatchSet: 11
Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Bhuvana Betini <bbe...@google.com>
Gerrit-Attention: Ritika Gupta <riti...@google.com>
Gerrit-Comment-Date: Thu, 16 Apr 2026 01:13:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Bhuvana Betini <bbe...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Bhuvana Betini (Gerrit)

unread,
Apr 16, 2026, 2:08:43 PMApr 16
to Wenyu Fu, Ritika Gupta, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ritika Gupta

Bhuvana Betini added 4 comments

File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
Line 64, Patchset 11: public ActorForegroundServiceControllerImpl() {}
Wenyu Fu . resolved

nit: Seems redundant?

Bhuvana Betini

Done

Line 81, Patchset 9: if (!(activity instanceof AsyncInitializationActivity asyncActivity)) return;
Ritika Gupta . resolved

Does this need to be AsyncInitializationActivity, can we check ChromeTabbedActivity here? @wen...@chromium.org

Bhuvana Betini

CTA import is banned in chrome/android

Bhuvana Betini

Marking as resolved.

Wenyu Fu . resolved

I'm not sure how to link `taskTabs.isEmpty()` with `isActivityVisibleForTask = true`... Is this an inexplicit assumption that if there's no tab associate with task, task is finishing, so we can make the notification silence?

Bhuvana Betini

Yes, I was finding this to be an issue with manual testing. It seems to create a race condition between taskTabs and the task itself when finishing.

Ritika Gupta

We figured out yesterday that as soon as task is completed/finished all the tabs related to actor task are cleaned up.

Wenyu Fu

In this case, it means this is a new notification sent while task is done. Should we send a non-silent notifications?

Bhuvana Betini

Oh, thanks for catching that. Making it return false!

Line 152, Patchset 11: }
}
}
}
Wenyu Fu . resolved

nit: Use early return to reduce indentation

Bhuvana Betini

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ritika Gupta
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
    Gerrit-Change-Number: 7745681
    Gerrit-PatchSet: 12
    Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
    Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
    Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
    Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
    Gerrit-Attention: Ritika Gupta <riti...@google.com>
    Gerrit-Comment-Date: Thu, 16 Apr 2026 18:08:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Ritika Gupta (Gerrit)

    unread,
    Apr 17, 2026, 6:05:45 PM (13 days ago) Apr 17
    to Bhuvana Betini, Wenyu Fu, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Bhuvana Betini

    Ritika Gupta added 14 comments

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    Ritika Gupta . unresolved

    I am going to send more comments,

    for notificationService and ActorFGSManager.

    File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
    Line 134, Patchset 12 (Latest): if (!(activity instanceof AsyncInitializationActivity aia)) return false;
    Ritika Gupta . unresolved

    aia looks strange lets call the variable asyncInitActivity.

    File chrome/android/junit/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImplTest.java
    Line 206, Patchset 12 (Latest): ApplicationStatus.onStateChangeForTesting(mChromeActivity, ActivityState.CREATED);
    ApplicationStatus.onStateChangeForTesting(mChromeActivity, ActivityState.RESUMED);
    Ritika Gupta . unresolved

    Comment for overall tests methods for new behaviour.

    Just to check, do we need both created and resumed states for the activity everywhere? I think setting the final state should be enough.

    May be add test for Settings activity and see it is not silent.

    File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceController.java
    Line 61, Patchset 12 (Latest): * Returns true if there is a visible Chrome activity that is currently showing one of the tabs
    * the given task is acting on.
    Ritika Gupta . unresolved

    nit : that has one of the tabs, the given task is acting on.

    File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceManager.java
    Line 143, Patchset 12 (Latest): boolean isSilent = task != null && mServiceController.isActivityVisibleForTask(task);
    Ritika Gupta . unresolved
    Could we have a method in this class, saying:
    ```
    public boolean isActivityVisibleForTask(int taskId){
    ActorTask task = mNotificationService.getTask(taskId);
    boolean isSilent = task != null && mServiceController.isActivityVisible(task.getTabs());
    }
    ```
    mServiceController doesnt need to know about the actor task.
    Line 142, Patchset 12 (Latest): ActorTask task = mNotificationService.getTask(taskId);

    boolean isSilent = task != null && mServiceController.isActivityVisibleForTask(task);
    mNotificationService.updateNotificationForTask(taskId, newState, isSilent);
    Ritika Gupta . unresolved

    Simplifies to:
    ```
    mNotificationService.updateNotificationForTask(taskId, newState, isActivityVisibleForTask(taskId));
    ```

    Now even when we call updateNotificationForTask, we need to ensure that if the category of notification is same, we shouldnt popup notification.

    Line 207, Patchset 12 (Latest): ActorTask task = mNotificationService.getTask(mPinnedNotificationId);

    boolean isSilent =
    task != null && mServiceController.isActivityVisibleForTask(task);
    Ritika Gupta . unresolved

    same as above

    File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactory.java
    Line 75, Patchset 12 (Latest): if (state == ActorTaskState.ACTING || state == ActorTaskState.REFLECTING) {
    Ritika Gupta . unresolved

    add state == ActorTaskState.CREATED here.

    Line 102, Patchset 12 (Latest): if (state == ActorTaskState.ACTING || state == ActorTaskState.REFLECTING) {
    Ritika Gupta . unresolved

    add state == ActorTaskState.CREATED here.

    File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
    Line 28, Patchset 12 (Latest): private static final String TAG = "ActNotification";
    Ritika Gupta . unresolved

    nit : ActorNotification

    unrelated to CL

    Line 47, Patchset 12 (Latest): * @param isSilent Whether the notification should be silent if it needs to be built.
    Ritika Gupta . unresolved

    nit : or popup.

    Line 98, Patchset 12 (Latest): * @param isSilent Whether the notification should be silent if it needs to be built.
    Ritika Gupta . unresolved

    or popup

    Line 104, Patchset 12 (Latest): if (notification != null && notification.isSilent() != isSilent) {
    notification = null;
    }
    Ritika Gupta . unresolved

    what does this mean? that if cache have a notification but it is silent whereas it should be non-silent that set is null, so that the next block could execute.

    This code logic is hard to read.

    Line 125, Patchset 12 (Latest): @Nullable ActorTask getTask(int taskId) {
    ActorTask task = mTaskCache.get(taskId);
    if (task == null) {
    task = mKeyedService.getTask(taskId);
    if (task != null) {
    mTaskCache.put(taskId, task);
    }
    }
    return task;
    }
    Ritika Gupta . unresolved
    Nit or directly at the calling site
    ```
    @Nullable ActorTask getTask(int taskId) {
    return mTaskCache.computeIfAbsent(taskId, mKeyedService::getTask);
    }
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Bhuvana Betini
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
      Gerrit-Change-Number: 7745681
      Gerrit-PatchSet: 12
      Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
      Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
      Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
      Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
      Gerrit-Attention: Bhuvana Betini <bbe...@google.com>
      Gerrit-Comment-Date: Fri, 17 Apr 2026 22:05:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ritika Gupta (Gerrit)

      unread,
      Apr 17, 2026, 6:54:04 PM (13 days ago) Apr 17
      to Bhuvana Betini, Wenyu Fu, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Bhuvana Betini

      Ritika Gupta added 1 comment

      File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
      Line 104, Patchset 12 (Latest): if (notification != null && notification.isSilent() != isSilent) {
      Ritika Gupta . unresolved

      we shouldn't update the notification only because it differs from previous state in terms of silence.


      Overall logic should be here as well :

      If notification category is same, we shouldn't update the notification.
      Also we somehow need some refactoring,

      Like see in notification cache, task state cache and have a single method to simplify the logic for both.

      and use it both for updateNotificationForTask and in getCachedNotification.

      Gerrit-Comment-Date: Fri, 17 Apr 2026 22:53:55 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Bhuvana Betini (Gerrit)

      unread,
      Apr 20, 2026, 7:05:14 PM (10 days ago) Apr 20
      to Wenyu Fu, Ritika Gupta, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Ritika Gupta

      Bhuvana Betini added 15 comments

      Patchset-level comments
      File-level comment, Patchset 12:
      Ritika Gupta . resolved

      I am going to send more comments,

      for notificationService and ActorFGSManager.

      Bhuvana Betini

      Acknowledged

      File chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
      Line 134, Patchset 12: if (!(activity instanceof AsyncInitializationActivity aia)) return false;
      Ritika Gupta . resolved

      aia looks strange lets call the variable asyncInitActivity.

      Bhuvana Betini

      Done

      File chrome/android/junit/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImplTest.java
      Line 206, Patchset 12: ApplicationStatus.onStateChangeForTesting(mChromeActivity, ActivityState.CREATED);
      ApplicationStatus.onStateChangeForTesting(mChromeActivity, ActivityState.RESUMED);
      Ritika Gupta . resolved

      Comment for overall tests methods for new behaviour.

      Just to check, do we need both created and resumed states for the activity everywhere? I think setting the final state should be enough.

      May be add test for Settings activity and see it is not silent.

      Bhuvana Betini

      It seems that we do need to set CREATED first, so I kept only that state.

      Test added.

      File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceController.java
      Line 61, Patchset 12: * Returns true if there is a visible Chrome activity that is currently showing one of the tabs

      * the given task is acting on.
      Ritika Gupta . resolved

      nit : that has one of the tabs, the given task is acting on.

      Bhuvana Betini

      Done

      File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceManager.java
      Line 143, Patchset 12: boolean isSilent = task != null && mServiceController.isActivityVisibleForTask(task);
      Ritika Gupta . resolved
      Could we have a method in this class, saying:
      ```
      public boolean isActivityVisibleForTask(int taskId){
      ActorTask task = mNotificationService.getTask(taskId);
      boolean isSilent = task != null && mServiceController.isActivityVisible(task.getTabs());
      }
      ```
      mServiceController doesnt need to know about the actor task.
      Bhuvana Betini

      Done

      Line 142, Patchset 12: ActorTask task = mNotificationService.getTask(taskId);

      boolean isSilent = task != null && mServiceController.isActivityVisibleForTask(task);
      mNotificationService.updateNotificationForTask(taskId, newState, isSilent);
      Ritika Gupta . resolved

      Simplifies to:
      ```
      mNotificationService.updateNotificationForTask(taskId, newState, isActivityVisibleForTask(taskId));
      ```

      Now even when we call updateNotificationForTask, we need to ensure that if the category of notification is same, we shouldnt popup notification.

      Bhuvana Betini

      Done

      Line 207, Patchset 12: ActorTask task = mNotificationService.getTask(mPinnedNotificationId);

      boolean isSilent =
      task != null && mServiceController.isActivityVisibleForTask(task);
      Ritika Gupta . resolved

      same as above

      Bhuvana Betini

      Done

      File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactory.java
      Line 75, Patchset 12: if (state == ActorTaskState.ACTING || state == ActorTaskState.REFLECTING) {
      Ritika Gupta . resolved

      add state == ActorTaskState.CREATED here.

      Bhuvana Betini

      Done

      Line 102, Patchset 12: if (state == ActorTaskState.ACTING || state == ActorTaskState.REFLECTING) {
      Ritika Gupta . resolved

      add state == ActorTaskState.CREATED here.

      Bhuvana Betini

      Done

      File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
      Line 28, Patchset 12: private static final String TAG = "ActNotification";
      Ritika Gupta . resolved

      nit : ActorNotification

      unrelated to CL

      Bhuvana Betini

      Done

      Line 47, Patchset 12: * @param isSilent Whether the notification should be silent if it needs to be built.
      Ritika Gupta . resolved

      nit : or popup.

      Bhuvana Betini

      Done

      Line 98, Patchset 12: * @param isSilent Whether the notification should be silent if it needs to be built.
      Ritika Gupta . resolved

      or popup

      Bhuvana Betini

      Done

      Line 104, Patchset 12: if (notification != null && notification.isSilent() != isSilent) {
      Ritika Gupta . resolved

      we shouldn't update the notification only because it differs from previous state in terms of silence.


      Overall logic should be here as well :

      If notification category is same, we shouldn't update the notification.
      Also we somehow need some refactoring,

      Like see in notification cache, task state cache and have a single method to simplify the logic for both.

      and use it both for updateNotificationForTask and in getCachedNotification.

      Bhuvana Betini

      Done

      Line 104, Patchset 12: if (notification != null && notification.isSilent() != isSilent) {
      notification = null;
      }
      Ritika Gupta . resolved

      what does this mean? that if cache have a notification but it is silent whereas it should be non-silent that set is null, so that the next block could execute.

      This code logic is hard to read.

      Bhuvana Betini

      Done

      Line 125, Patchset 12: @Nullable ActorTask getTask(int taskId) {

      ActorTask task = mTaskCache.get(taskId);
      if (task == null) {
      task = mKeyedService.getTask(taskId);
      if (task != null) {
      mTaskCache.put(taskId, task);
      }
      }
      return task;
      }
      Ritika Gupta . resolved
      Nit or directly at the calling site
      ```
      @Nullable ActorTask getTask(int taskId) {
      return mTaskCache.computeIfAbsent(taskId, mKeyedService::getTask);
      }
      ```
      Bhuvana Betini

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ritika Gupta
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
        Gerrit-Change-Number: 7745681
        Gerrit-PatchSet: 13
        Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
        Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
        Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
        Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
        Gerrit-Attention: Ritika Gupta <riti...@google.com>
        Gerrit-Comment-Date: Mon, 20 Apr 2026 23:05:05 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Ritika Gupta <riti...@google.com>
        satisfied_requirement
        open
        diffy

        Ritika Gupta (Gerrit)

        unread,
        Apr 20, 2026, 9:19:23 PM (10 days ago) Apr 20
        to Bhuvana Betini, Wenyu Fu, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
        Attention needed from Bhuvana Betini

        Ritika Gupta added 2 comments

        Patchset-level comments
        File-level comment, Patchset 13 (Latest):
        Ritika Gupta . resolved

        Please fix tests.

        File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
        Line 107, Patchset 13 (Latest): NotificationWrapper cached = mNotificationCache.get(taskId);
        Ritika Gupta . unresolved

        nit : cachedNotification

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Bhuvana Betini
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
          Gerrit-Change-Number: 7745681
          Gerrit-PatchSet: 13
          Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
          Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
          Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
          Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
          Gerrit-Attention: Bhuvana Betini <bbe...@google.com>
          Gerrit-Comment-Date: Tue, 21 Apr 2026 01:19:13 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ritika Gupta (Gerrit)

          unread,
          Apr 20, 2026, 9:20:56 PM (10 days ago) Apr 20
          to Bhuvana Betini, Wenyu Fu, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org
          Attention needed from Bhuvana Betini

          Ritika Gupta voted and added 1 comment

          Votes added by Ritika Gupta

          Code-Review+1

          1 comment

          Patchset-level comments
          Ritika Gupta . unresolved

          Thanks, nits + fix tests. LGTM overall.
          Please check the behaviour manually in all cases.

          Gerrit-Comment-Date: Tue, 21 Apr 2026 01:20:44 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Bhuvana Betini (Gerrit)

          unread,
          Apr 20, 2026, 10:52:26 PM (10 days ago) Apr 20
          to Ritika Gupta, Wenyu Fu, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org

          Bhuvana Betini added 2 comments

          Patchset-level comments
          File-level comment, Patchset 13:
          Ritika Gupta . resolved

          Thanks, nits + fix tests. LGTM overall.
          Please check the behaviour manually in all cases.

          Bhuvana Betini

          Acknowledged

          File chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
          Line 107, Patchset 13: NotificationWrapper cached = mNotificationCache.get(taskId);
          Ritika Gupta . resolved

          nit : cachedNotification

          Bhuvana Betini

          Done

          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
            Gerrit-Change-Number: 7745681
            Gerrit-PatchSet: 15
            Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
            Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
            Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
            Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
            Gerrit-Comment-Date: Tue, 21 Apr 2026 02:52:18 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Ritika Gupta <riti...@google.com>
            satisfied_requirement
            open
            diffy

            Bhuvana Betini (Gerrit)

            unread,
            Apr 21, 2026, 2:26:00 PM (9 days ago) Apr 21
            to Ritika Gupta, Wenyu Fu, Chromium LUCI CQ, chromium...@chromium.org, mfoltz+wa...@chromium.org

            Bhuvana Betini voted Commit-Queue+2

            Commit-Queue+2
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
            Gerrit-Change-Number: 7745681
            Gerrit-PatchSet: 15
            Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
            Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
            Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
            Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
            Gerrit-Comment-Date: Tue, 21 Apr 2026 18:25:53 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Apr 21, 2026, 2:29:35 PM (9 days ago) Apr 21
            to Bhuvana Betini, Ritika Gupta, Wenyu Fu, chromium...@chromium.org, mfoltz+wa...@chromium.org

            Chromium LUCI CQ submitted the change with unreviewed changes

            Unreviewed changes

            13 is the latest approved patch-set.
            The change was submitted with unreviewed changes in the following files:

            ```
            The name of the file: chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
            Insertions: 22, Deletions: 5.

            @@ -73,6 +73,13 @@
            }

            Integer oldState = mTaskStates.get(taskId);
            +
            + // If the task appears to have regressed to CREATED from a terminal state, it's likely
            + // because the native task was destroyed. In this case, we trust our cached state.
            + if (oldState != null && isTerminalState(oldState) && newState == ActorTaskState.CREATED) {
            + newState = oldState;
            + }
            +
            if (oldState != null
            && !ActorNotificationFactory.shouldUpdateNotification(oldState, newState)) {
            mTaskStates.put(taskId, newState);
            @@ -104,17 +111,27 @@
            if (task == null) return null;

            @ActorTaskState int state = task.getState();
            - NotificationWrapper cached = mNotificationCache.get(taskId);
            + NotificationWrapper cachedNotification = mNotificationCache.get(taskId);
            Integer oldState = mTaskStates.get(taskId);

            - if (cached == null
            + if (oldState != null && isTerminalState(oldState) && state == ActorTaskState.CREATED) {
            + state = oldState;
            + }
            +
            + if (cachedNotification == null
            || oldState == null
            || ActorNotificationFactory.shouldUpdateNotification(oldState, state)) {
            - cached = ActorNotificationFactory.buildNotification(task, state, isSilent);
            - mNotificationCache.put(taskId, cached);
            + cachedNotification = ActorNotificationFactory.buildNotification(task, state, isSilent);
            + mNotificationCache.put(taskId, cachedNotification);
            mTaskStates.put(taskId, state);
            }
            - return cached;
            + return cachedNotification;
            + }
            +
            + private boolean isTerminalState(@ActorTaskState int state) {
            + return state == ActorTaskState.FINISHED
            + || state == ActorTaskState.FAILED
            + || state == ActorTaskState.CANCELLED;
            }

            /**
            ```

            Change information

            Commit message:
            [Glic] Make notifications silent only if we are not in PiP or in CTA
            Bug: 494093802
            Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
            Reviewed-by: Wenyu Fu <wen...@chromium.org>
            Reviewed-by: Ritika Gupta <riti...@google.com>
            Commit-Queue: Bhuvana Betini <bbe...@google.com>
            Cr-Commit-Position: refs/heads/main@{#1618332}
            Files:
            • M chrome/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImpl.java
            • M chrome/android/junit/src/org/chromium/chrome/browser/actor/ActorForegroundServiceControllerImplTest.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceController.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceManager.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorForegroundServiceManagerTest.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactory.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationFactoryTest.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationService.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/ActorNotificationServiceTest.java
            • M chrome/browser/actor/android/java/src/org/chromium/chrome/browser/actor/NoOpActorForegroundServiceController.java
            Change size: L
            Delta: 10 files changed, 273 insertions(+), 110 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Wenyu Fu, +1 by Ritika Gupta
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I61f3eb0c3edf8009db861561e2862b97db587b3b
            Gerrit-Change-Number: 7745681
            Gerrit-PatchSet: 16
            Gerrit-Owner: Bhuvana Betini <bbe...@google.com>
            Gerrit-Reviewer: Bhuvana Betini <bbe...@google.com>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Ritika Gupta <riti...@google.com>
            Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
            open
            diffy
            satisfied_requirement
            Reply all
            Reply to author
            Forward
            0 new messages