The current code remove duplicate text by checking if the current screen text is duplicated based on text buffer.
However, if a user switch from the current foreground app to another app by the following 3 ways:
- home screen
- switch between running apps
- check the notification messages
The screen text sensor need to collect the text on the screen even the text is duplicated based on the text buffer.
If not, the screen text in above 3 cases will be ignored. As a result, we will not collect screen full text data to analyze app switch behaviors.
To solve this, we could check if the foreground app is changed. As a result, when the screen text is already in text buffer, but the foreground app changed, the screen text will still be added into text buffer.
The current code remove duplicate text by checking if the current screen text is duplicated based on text buffer.
However, if a user switch from the current foreground app to another app by the following 3 ways:
The screen text sensor need to collect the text on the screen even the text is duplicated based on the text buffer.
If not, the screen text in above 3 cases will be ignored. As a result, we will not collect screen full text data to analyze app switch behaviors.
To solve this, we could check if the foreground app is changed. As a result, when the screen text is already in text buffer, but the foreground app changed, the screen text will still be added into text buffer.