зеркало из https://github.com/mozilla/gecko-dev.git
Bug 896350 - Don't close notifications unless explicitly requested to. r=blassey
This commit is contained in:
Родитель
41ae7f1c19
Коммит
f36d020ed4
|
@ -1283,11 +1283,6 @@ public class GeckoAppShell
|
|||
public static void alertsProgressListener_OnProgress(String aAlertName, long aProgress, long aProgressMax, String aAlertText) {
|
||||
int notificationID = aAlertName.hashCode();
|
||||
sNotificationClient.update(notificationID, aProgress, aProgressMax, aAlertText);
|
||||
|
||||
if (aProgress == aProgressMax) {
|
||||
// Hide the notification at 100%
|
||||
removeObserver(aAlertName);
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeNotification(String aAlertName) {
|
||||
|
|
|
@ -102,11 +102,6 @@ public class NotificationHandler {
|
|||
if (mForegroundNotification == null && isOngoing(notification)) {
|
||||
setForegroundNotification(notificationID, notification);
|
||||
}
|
||||
|
||||
// Hide the notification at 100%
|
||||
if (aProgress == aProgressMax) {
|
||||
remove(notificationID);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,7 +42,7 @@ var Downloads = {
|
|||
let f = this._getLocalFile(fileUri);
|
||||
try {
|
||||
f.launch();
|
||||
} catch (ex) {
|
||||
} catch (ex) {
|
||||
// in case we are not able to open the file (i.e. there is no app able to handle it)
|
||||
// we just open the browser tab showing it
|
||||
BrowserApp.addTab("about:downloads?id=" + guid);
|
||||
|
|
|
@ -86,7 +86,6 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const nsAString & aImageUrl
|
|||
}
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
mozilla::AndroidBridge::Bridge()->CloseNotification(aAlertName);
|
||||
mozilla::AndroidBridge::Bridge()->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertCookie,
|
||||
aAlertListener, aAlertName);
|
||||
return NS_OK;
|
||||
|
|
|
@ -707,8 +707,10 @@ AndroidBridge::ShowAlertNotification(const nsAString& aImageUrl,
|
|||
|
||||
AutoLocalJNIFrame jniFrame(env);
|
||||
|
||||
if (nsAppShell::gAppShell && aAlertListener)
|
||||
if (nsAppShell::gAppShell && aAlertListener) {
|
||||
// This will remove any observers already registered for this id
|
||||
nsAppShell::gAppShell->AddObserver(aAlertName, aAlertListener);
|
||||
}
|
||||
|
||||
jvalue args[5];
|
||||
args[0].l = NewJavaString(&jniFrame, aImageUrl);
|
||||
|
|
Загрузка…
Ссылка в новой задаче