Question: My application makes a call to the server which may take a few seconds. The user can minimize the App before receiving the response from the server.

So what I am trying to do is that if the App is minimized when it receives the response from the server, it will go to PIP mode.

When I try to enter Pip mode with the application minimized I get this error:

```
java.lang.IllegalStateException: Activity must be resumed to enter picture-in-picture

```

The error occurs when this line is executed:

```
enterPictureInPictureMode();

```

Thanks.

Answer: 
Finally I found out, the problem comes from the installation of the server.
I used to change the my.cnf as usual, and some variables are changed at each restart and others no.

And I realised that there is an other conf file, and this file orverwrite the changes I have made in the my.cnf file for some variables...
Now I change the good file, and the server is working as excepting.

So if mariaDB ignore your changes in the conf file check if there is an other file.
Although it may see advantageous to increase `max_connections`, it will only make things worse. It sounds like you have lots of connections stumbling over each other -- none finishing.

Look at `SHOW PROCESSLIST`. One of the non-Sleeping ones with the largest "Time" (other than 'system' processes) *may* be the main offender.

If the Processlist shows more than, say, 30 connections that are non "Sleep", then lower `max_connections` and the timeouts. These will help unclog the system, but won't get to the root of the problem.

The "cause" is often one or a few long-running queries that block other connections. Let's try to find the offending query by using the slowlog: <http://mysql.rjweb.org/doc.php/mysql_analysis#slow_queries_and_slowlog>