导航菜单

页面标题

页面副标题

Petal Maps v4.7.0.310001 - TransportGetOffReminderService.java 源代码

正在查看: Petal Maps v4.7.0.310001 应用的 TransportGetOffReminderService.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.huawei.maps.transportation.service;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.net.Uri;
import android.os.Binder;
import android.os.IBinder;
import android.os.Vibrator;
import androidx.core.app.NotificationCompat;
import com.huawei.maps.transportation.R$drawable;
import com.huawei.maps.transportation.R$string;
import com.huawei.maps.transportation.listener.TransportReminderListener;
import com.huawei.secure.android.common.activity.SafeService;
import defpackage.p5a;

public class TransportGetOffReminderService extends SafeService {
    public NotificationManager b;
    public Notification c;
    public Notification d;
    public Notification e;
    public Notification f;
    public TransportReminderListener h;
    public boolean g = false;
    public kt3 i = new a();

    public class a extends kt3 {
        public a() {
        }

        public void onBusTakeoff(int i) {
            super.onBusTakeoff(i);
            if (i == 0) {
                if (TransportGetOffReminderService.this.b != null) {
                    TransportGetOffReminderService.this.b.cancel(1001);
                }
                TransportGetOffReminderService.this.n();
                ?? r6 = TransportGetOffReminderService.this;
                r6.j(1000, r6.getString(R$string.trans_navi_notification_coming_station));
                TransportGetOffReminderService.this.g = true;
                TransportGetOffReminderService.this.h();
                p5a.c().m(false);
                TransportGetOffReminderService.this.f();
                dx7.Q("routes_routeresult_vibrate", String.valueOf(0), p5a.c().d());
                dx7.Q("routes_routeresult_auto_remindexit", String.valueOf(0), p5a.c().d());
                hm4.p("TransportGetOffReminderService", "arrive station");
                return;
            }
            if (i == 1) {
                if (TransportGetOffReminderService.this.b != null) {
                    TransportGetOffReminderService.this.b.cancel(1002);
                }
                TransportGetOffReminderService.this.n();
                ?? r62 = TransportGetOffReminderService.this;
                r62.k(1001, r62.getString(R$string.trans_navi_notification_after_station));
                dx7.Q("routes_routeresult_vibrate", String.valueOf(1), p5a.c().d());
                hm4.p("TransportGetOffReminderService", "before_one_station_arrive");
                return;
            }
            if (i != 2) {
                if (i != 3) {
                    return;
                }
                TransportGetOffReminderService.this.n();
                ?? r63 = TransportGetOffReminderService.this;
                r63.l(r63.getString(R$string.trans_navi_notification_after_station));
                dx7.Q("routes_routeresult_vibrate", String.valueOf(3), p5a.c().d());
                hm4.p("TransportGetOffReminderService", "before_one_change_station");
                return;
            }
            if (TransportGetOffReminderService.this.b != null) {
                TransportGetOffReminderService.this.b.cancel(1003);
            }
            TransportGetOffReminderService.this.n();
            ?? r64 = TransportGetOffReminderService.this;
            r64.m(r64.getString(R$string.trans_navi_notification_coming_station));
            dx7.Q("routes_routeresult_vibrate", String.valueOf(2), p5a.c().d());
            hm4.p("TransportGetOffReminderService", "change_station");
        }
    }

    public class b extends Binder {
        public b() {
        }

        public TransportGetOffReminderService a() {
            return TransportGetOffReminderService.this;
        }
    }

    public final void f() {
        jq5.t().r0();
        it3.x().W(this.i);
    }

    public Notification g(String str) {
        NotificationManager notificationManager = (NotificationManager) getSystemService("notification");
        this.b = notificationManager;
        if (notificationManager != null) {
            NotificationChannel notificationChannel = new NotificationChannel("90000", o41.f(R$string.notification_channel_navigation), 2);
            notificationChannel.enableVibration(false);
            notificationChannel.setSound(null, null);
            notificationChannel.setLockscreenVisibility(1);
            this.b.createNotificationChannel(notificationChannel);
        }
        Intent launchIntentForPackage = o41.c().getPackageManager().getLaunchIntentForPackage(o41.b().getPackageName());
        launchIntentForPackage.setFlags(268435456);
        PendingIntent activity = PendingIntent.getActivity(this, 0, launchIntentForPackage, 201326592);
        NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "90000");
        builder.setContentText(str).setSmallIcon(R$drawable.appbg_color).setOngoing(false).setSound((Uri) null).setContentIntent(activity).setAutoCancel(true).setVisibility(1).setWhen(System.currentTimeMillis());
        return builder.build();
    }

    public final void h() {
        TransportReminderListener transportReminderListener = this.h;
        if (transportReminderListener != null) {
            transportReminderListener.setIsArrival(this.g);
        }
    }

    public void i(TransportReminderListener transportReminderListener) {
        this.h = transportReminderListener;
    }

    public void j(int i, String str) {
        if (this.d == null) {
            Notification g = g(str);
            this.d = g;
            g.flags = 16;
        }
        this.b.notify(i, this.d);
    }

    public void k(int i, String str) {
        if (this.c == null) {
            Notification g = g(str);
            this.c = g;
            g.flags = 16;
        }
        this.b.notify(i, this.c);
    }

    public void l(String str) {
        if (this.f == null) {
            Notification g = g(str);
            this.f = g;
            g.flags = 16;
        }
        this.b.notify(1003, this.f);
    }

    public void m(String str) {
        if (this.e == null) {
            Notification g = g(str);
            this.e = g;
            g.flags = 16;
        }
        this.b.notify(1002, this.e);
    }

    public final void n() {
        boolean i = p5a.i(o41.c());
        hm4.p("TransportGetOffReminderService", " canVibrator " + i);
        if (i) {
            ((Vibrator) o41.c().getSystemService("vibrator")).vibrate(new long[]{0, 1000, 1000, 1000, 1000, 1000, 1000}, -1);
        }
    }

    public IBinder onBind(Intent intent) {
        return new b();
    }

    public void onCreate() {
        super.onCreate();
        it3.x().c(this.i);
    }

    public void onDestroy() {
        super.onDestroy();
        NotificationManager notificationManager = this.b;
        if (notificationManager != null) {
            notificationManager.cancel(1000);
        }
        hm4.f("TransportGetOffReminderService", " TransportGetOffReminderService onDestroy ");
        stopForeground(true);
        stopSelf();
        jq5.t().r0();
        it3.x().W(this.i);
        com.huawei.maps.businessbase.manager.location.a.V(false);
        com.huawei.maps.businessbase.manager.location.a.d0();
    }

    public int onStartCommand(Intent intent, int i, int i2) {
        return super.onStartCommand(intent, i, i2);
    }
}