Skip to content

Commit

Permalink
Handle "<app> isn't responding" system popup (#1130)
Browse files Browse the repository at this point in the history
A system popup about an app not responding blocks most if not all
actions of MAD / RGC on a device. It's also usually a symptom of the
affected system having severe issues. A instant reboot is therefore
usually the correct and quickest solution.
  • Loading branch information
crhbetz authored Apr 8, 2021
1 parent 2ffcdb8 commit ec9cc6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mapadroid/ocr/screenPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ def __evaluate_topmost_app(self, topmost_app: str) -> Tuple[ScreenType, dict, in
return ScreenType.CREDENTIALS, global_dict, diff
elif "ConsentActivity" in topmost_app:
return ScreenType.CONSENT, global_dict, diff
elif "/a.m" in topmost_app:
self._logger.error("Likely found 'not responding' popup - reboot device (topmost app: {})", topmost_app)
return ScreenType.NOTRESPONDING, global_dict, diff
elif "com.nianticlabs.pokemongo" not in topmost_app:
self._logger.warning("PoGo is not opened! Current topmost app: {}", topmost_app)
return ScreenType.CLOSE, global_dict, diff
Expand Down
1 change: 1 addition & 0 deletions mapadroid/ocr/screen_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ScreenType(Enum):
GPS = 21 # GPS signal not found error message (pogo)
CREDENTIALS = 22 # new GrantCredentials dialog
NOGGL = 23 # loginselect, but without the google button (probably failed to set a correct birthdate)
NOTRESPONDING = 24 # system popup about an app not responding, blocking most actions
POGO = 99 # uhm, whatever... At least pogo is topmost, no idea where we are yet tho (in the process of switching)
ERROR = 100 # some issue occurred while handling screentypes or not able to determine screen
BLACK = 110 # screen is black, likely loading up game
Expand Down
3 changes: 3 additions & 0 deletions mapadroid/worker/WorkerBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ def _ensure_pogo_topmost(self):
self.logger.warning('Getting SN Screen - restart PoGo and later PD')
self._restart_pogo_safe()
break
elif screen_type == ScreenType.NOTRESPONDING:
self._reboot()
break

if self._loginerrorcounter > 1:
self.logger.warning('Could not login again - (clearing game data + restarting device')
Expand Down

0 comments on commit ec9cc6b

Please sign in to comment.