Skip to content

Commit

Permalink
[TIMOB-24316] Fix category condition and KrollRuntime hang
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Apr 5, 2017
1 parent de9bb40 commit 13138e3
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected void onCreate(Bundle savedInstanceState)
// TIMOB-24497: launching as CATEGORY_HOME or CATEGORY_DEFAULT prevents intent data from
// being passed to our resumed activity. Re-launch using CATEGORY_LAUNCHER.
Set<String> categories = intent.getCategories();
if (categories == null || categories.contains(Intent.CATEGORY_HOME)) {
if (categories == null || categories.contains(Intent.CATEGORY_HOME) || !categories.contains(Intent.CATEGORY_LAUNCHER)) {
finish();

if (categories != null) {
Expand All @@ -113,7 +113,13 @@ protected void onCreate(Bundle savedInstanceState)

restartActivity(100, 0);

KrollRuntime.incrementActivityRefCount();
KrollRuntime instance = KrollRuntime.getInstance();
if (instance != null && instance.getRuntimeState() != KrollRuntime.State.DISPOSED){
KrollRuntime.incrementActivityRefCount();
} else {
// something went wrong... force exit
System.exit(0);
}
activityOnCreate(savedInstanceState);
return;
}
Expand Down

0 comments on commit 13138e3

Please sign in to comment.