Commit 40b848b5 authored by Side Yilmaz's avatar Side Yilmaz Committed by Commit Bot

Replace deprecated getLastUsedProfile function in NotificationManager.

Profile#getLastUsedProfile| is deprecated and replaced with
|Profile#getLastUsedRegularProfile|. This CL updates NotificationManager
class.

Note: This change is only code clean-up, does not change any behaviour.

Bug: 1041781
Change-Id: I579739c552be2321632ff551898f7416ca976d18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2102539Reviewed-by: default avatarTravis Skare <skare@chromium.org>
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751274}
parent 830bf615
......@@ -63,21 +63,22 @@ public class NotificationManager {
final String action = intent.getAction();
final String guid =
IntentUtils.safeGetStringExtra(intent, NOTIFICATION_GUID_EXTRA);
// TODO(https://crbug.com/1041781): Use the current profile (i.e.,
// regular profile or incognito profile) instead of always using
// regular profile. It is wrong and need to be fixed.
final Profile profile = Profile.getLastUsedRegularProfile();
switch (action) {
case NOTIFICATION_ACTION_TAP:
openUrl(intent.getData());
hideNotification(guid, InteractionType.OPENED);
SendTabToSelfAndroidBridge.deleteEntry(
Profile.getLastUsedProfile(), guid);
SendTabToSelfAndroidBridge.deleteEntry(profile, guid);
break;
case NOTIFICATION_ACTION_DISMISS:
hideNotification(guid, InteractionType.DISMISSED);
SendTabToSelfAndroidBridge.dismissEntry(
Profile.getLastUsedProfile(), guid);
SendTabToSelfAndroidBridge.dismissEntry(profile, guid);
break;
case NOTIFICATION_ACTION_TIMEOUT:
SendTabToSelfAndroidBridge.dismissEntry(
Profile.getLastUsedProfile(), guid);
SendTabToSelfAndroidBridge.dismissEntry(profile, guid);
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment