Extract a function to determine whether to upload log

Extract the logic to determine whether to upload log into a public function. This function will later be used by a module that handles user bug report, as the module need to know whether the corresponding logs will be uploaded with the bug report.

Test: unittest
Bug: 328677995
Change-Id: I7b5f630da72a6c1b97b890437fa62e3a5b6ed762
3 files changed