55 lines
1.7 KiB
Java
55 lines
1.7 KiB
Java
|
package androidx.work;
|
||
|
|
||
|
import android.app.Notification;
|
||
|
import androidx.annotation.NonNull;
|
||
|
public final class ForegroundInfo {
|
||
|
private final int mForegroundServiceType;
|
||
|
private final Notification mNotification;
|
||
|
private final int mNotificationId;
|
||
|
|
||
|
public ForegroundInfo(int i, @NonNull Notification notification) {
|
||
|
this(i, notification, 0);
|
||
|
}
|
||
|
|
||
|
public ForegroundInfo(int i, @NonNull Notification notification, int i2) {
|
||
|
this.mNotificationId = i;
|
||
|
this.mNotification = notification;
|
||
|
this.mForegroundServiceType = i2;
|
||
|
}
|
||
|
|
||
|
public boolean equals(Object obj) {
|
||
|
if (this == obj) {
|
||
|
return true;
|
||
|
}
|
||
|
if (obj == null || ForegroundInfo.class != obj.getClass()) {
|
||
|
return false;
|
||
|
}
|
||
|
ForegroundInfo foregroundInfo = (ForegroundInfo) obj;
|
||
|
if (this.mNotificationId == foregroundInfo.mNotificationId && this.mForegroundServiceType == foregroundInfo.mForegroundServiceType) {
|
||
|
return this.mNotification.equals(foregroundInfo.mNotification);
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
public int getForegroundServiceType() {
|
||
|
return this.mForegroundServiceType;
|
||
|
}
|
||
|
|
||
|
@NonNull
|
||
|
public Notification getNotification() {
|
||
|
return this.mNotification;
|
||
|
}
|
||
|
|
||
|
public int getNotificationId() {
|
||
|
return this.mNotificationId;
|
||
|
}
|
||
|
|
||
|
public int hashCode() {
|
||
|
return this.mNotification.hashCode() + (((this.mNotificationId * 31) + this.mForegroundServiceType) * 31);
|
||
|
}
|
||
|
|
||
|
public String toString() {
|
||
|
return "ForegroundInfo{mNotificationId=" + this.mNotificationId + ", mForegroundServiceType=" + this.mForegroundServiceType + ", mNotification=" + this.mNotification + '}';
|
||
|
}
|
||
|
}
|