package com.audio.record.screen.test.service;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;
 
public class CustomLifecycleOwner implements LifecycleOwner {
    private final LifecycleRegistry lifecycleRegistry = new LifecycleRegistry(this);
 
    @Override
    public Lifecycle getLifecycle() {
        return lifecycleRegistry;
    }
 
    public void onStart() {
        lifecycleRegistry.markState(Lifecycle.State.STARTED);
    }
 
    public void onStop() {
        lifecycleRegistry.markState(Lifecycle.State.CREATED);
    }
}