导航菜单

页面标题

页面副标题

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

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

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


package com.huawei.maps.navi.service;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import androidx.annotation.Nullable;
import com.huawei.secure.android.common.activity.SafeService;
import defpackage.ar5;

public class NaviForegroundService extends SafeService {
    public static final String b = "NaviForegroundService";

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

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

    public void a() {
        ar5.c().g();
        String str = b;
        hm4.p(str, "navi notification execution startForeground: " + System.currentTimeMillis());
        Notification d = ar5.c().d();
        if (Build.VERSION.SDK_INT >= 29) {
            startForeground(1000, d, -1);
        } else {
            startForeground(1000, d);
        }
        if (ar5.c().l() || !c06.b()) {
            ar5.c().k(false);
            ar5.c().j(false);
            hm4.h(str, "navi notification foreground service stop self");
            b();
        }
    }

    public final void b() {
        try {
            stopForeground(true);
            stopSelf();
        } catch (Exception unused) {
            hm4.h(b, "stopService: Exception");
        }
    }

    @Nullable
    public IBinder onBind(Intent intent) {
        return new a();
    }

    public void onCreate() {
        hm4.p(b, "navi notification foreground service create: " + System.currentTimeMillis());
        super.onCreate();
        ar5.c().j(true);
    }

    public void onDestroy() {
        hm4.p(b, "navi notification foreground service destroy.");
        NotificationManager f = ar5.c().f();
        if (f != null) {
            f.cancel(1000);
        }
        b();
        ar5.c().i();
        super.onDestroy();
    }
}