You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Any method that runs in the UI thread should do as little work as possible on that thread. In particular, activities should do as little as possible in key life-cycle methods such as onCreate(). Potentially long running operations such as network or database operations should be done in a worker thread (e.g., via AsyncTask)."
I found the following event handlers transitively performing heavy operations:
dev.ukanth.ufirewall.LogActivity.onCreate() which calls File IO operations.
The call hierarchy is shown below:
dev.ukanth.ufirewall.Api.parseLog(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
dev.ukanth.ufirewall.LogActivity.parseAndSet(Landroid/content/Context;Ljava/lang/String;)V
dev.ukanth.ufirewall.LogActivity.populateData(Landroid/content/Context;)V
dev.ukanth.ufirewall.DataDumpActivity.onCreate(Landroid/os/Bundle;)V
dev.ukanth.ufirewall.LogActivity.onCreate(Landroid/os/Bundle;)V
Do you think these operations affect AFWall+'s performance? If yes, perhaps moving these actions to a separate thread can help make AFWall+ super smooth in user interaction. Looking forward to your reply and hope I can help improve AFWall+.
The text was updated successfully, but these errors were encountered:
The call to getApps() "probably" uses the cached copy, but if it has to query PackageManager and read the preferences, it could block. This could be a slow operation on devices with hundreds/thousands of apps.
The use of BufferedReader to parse a string line-by-line may generate false positives for a static checker looking for file-related calls.
Is there anything else inside this function to worry about?
IIRC there are still some random SU calls that might run from the UI thread (although the worst ones are gone).
Thanks for your prompt feedback.
I am a undergraduate student doing research for android apps.
The static checker I implemented seems to need more polish.
I will double check for the issues you mentioned above.
Again, thanks for your explanation and comments. :)
Dear developers,
I am analyzing AFWall+ using a static code checker. I found some potential slow operations in AFWall+'s UI thread.
Android documentation says this:
http://developer.android.com/training/articles/perf-anr.html
"Any method that runs in the UI thread should do as little work as possible on that thread. In particular, activities should do as little as possible in key life-cycle methods such as onCreate(). Potentially long running operations such as network or database operations should be done in a worker thread (e.g., via AsyncTask)."
I found the following event handlers transitively performing heavy operations:
dev.ukanth.ufirewall.LogActivity.onCreate() which calls File IO operations.
The call hierarchy is shown below:
dev.ukanth.ufirewall.Api.parseLog(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
dev.ukanth.ufirewall.LogActivity.parseAndSet(Landroid/content/Context;Ljava/lang/String;)V
dev.ukanth.ufirewall.LogActivity.populateData(Landroid/content/Context;)V
dev.ukanth.ufirewall.DataDumpActivity.onCreate(Landroid/os/Bundle;)V
dev.ukanth.ufirewall.LogActivity.onCreate(Landroid/os/Bundle;)V
Do you think these operations affect AFWall+'s performance? If yes, perhaps moving these actions to a separate thread can help make AFWall+ super smooth in user interaction. Looking forward to your reply and hope I can help improve AFWall+.
The text was updated successfully, but these errors were encountered: