package com.android.server.locksettings;

import android.os.IBinder;
import android.os.ServiceManager;
import android.util.Slog;

import com.android.secureline.ISecureLineManager;

public final class SecureLineUnlockBridge {
    private static final String TAG = "SecureLineUnlockBridge";

    private SecureLineUnlockBridge() {}

    public static void notifyVerifiedUnlock() {
        try {
            IBinder binder = ServiceManager.getService("secureline");
            if (binder == null) {
                Slog.w(TAG, "secureline service not found");
                return;
            }

            ISecureLineManager svc = ISecureLineManager.Stub.asInterface(binder);
            if (svc == null) {
                Slog.w(TAG, "secureline interface null");
                return;
            }

            svc.notifyVerifiedUnlock();
        } catch (Throwable t) {
            Slog.e(TAG, "Failed to notify SecureLine verified unlock", t);
        }
    }
}
