{"action":"created","issue":{"url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3241","labels_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3241/labels{/name}","comments_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3241/comments","events_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3241/events","html_url":"https://github.com/crosswalk-project/crosswalk/pull/3241","id":104938952,"number":3241,"title":"[Android] Simplify the resource interception code in XWalkViewDelegate.","user":{"login":"rakuco","id":36417,"avatar_url":"https://avatars.githubusercontent.com/u/36417?v=3","gravatar_id":"","url":"https://api.github.com/users/rakuco","html_url":"https://github.com/rakuco","followers_url":"https://api.github.com/users/rakuco/followers","following_url":"https://api.github.com/users/rakuco/following{/other_user}","gists_url":"https://api.github.com/users/rakuco/gists{/gist_id}","starred_url":"https://api.github.com/users/rakuco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakuco/subscriptions","organizations_url":"https://api.github.com/users/rakuco/orgs","repos_url":"https://api.github.com/users/rakuco/repos","events_url":"https://api.github.com/users/rakuco/events{/privacy}","received_events_url":"https://api.github.com/users/rakuco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-04T18:01:36Z","updated_at":"2015-09-04T18:07:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3241","html_url":"https://github.com/crosswalk-project/crosswalk/pull/3241","diff_url":"https://github.com/crosswalk-project/crosswalk/pull/3241.diff","patch_url":"https://github.com/crosswalk-project/crosswalk/pull/3241.patch"},"body":"There are two related changes in this patch with the same goal of paving the way for the M45 rebase, where the upstream code handling the loading of Android resources has changed. Most of what we had to do there also applies to M44, so the patch is being landed in master in order to make it clear in the commit history what is being done and why.\r\n\r\n1. Make the code easier to understand.\r\n   * Set up the resource interception infrastructure in a separate\r\n     function.\r\n   * Also have a separate function for determining a resource ID after\r\n     XWALK-3469 made the code a bit harder to follow.\r\n   * Have variables with clear names such as `isSharedMode` and\r\n     `isTestApk` to indicate our intents and what is being checked. We\r\n     were previously relying on package name checks or ID comparisons\r\n     that did not make any sense to anyone who was not already familiar\r\n     with the code base.\r\n   * Add more comments to the code to indicate what we are doing.\r\n2. Functional changes.\r\n   * Stop conditionally calling setResourceIntercepter(). The previous\r\n     check basically skipped our test APKs. Since intercepting resources\r\n     there does not cause any harm, do so to make the code easier to\r\n     both write and understand.\r\n   * Remove \"en-US.pak\" from the list of mandatory PAK files. It has\r\n     never actually existed in our Android builds, and since we now use\r\n     `MANDATORY_PAK_FILES` to determine which resources need to be\r\n     intercepted, we cannot have a non-existent file there as we would\r\n     end up trying to open it.\r\n\r\nMost of the code was actually written by @lincsoon in pull request #3220, I only picked as much as I could into master.\r\n\r\nRelated to: XWALK-4755\r\n"},"comment":{"url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/comments/137808180","html_url":"https://github.com/crosswalk-project/crosswalk/pull/3241#issuecomment-137808180","issue_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3241","id":137808180,"user":{"login":"rakuco","id":36417,"avatar_url":"https://avatars.githubusercontent.com/u/36417?v=3","gravatar_id":"","url":"https://api.github.com/users/rakuco","html_url":"https://github.com/rakuco","followers_url":"https://api.github.com/users/rakuco/followers","following_url":"https://api.github.com/users/rakuco/following{/other_user}","gists_url":"https://api.github.com/users/rakuco/gists{/gist_id}","starred_url":"https://api.github.com/users/rakuco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakuco/subscriptions","organizations_url":"https://api.github.com/users/rakuco/orgs","repos_url":"https://api.github.com/users/rakuco/repos","events_url":"https://api.github.com/users/rakuco/events{/privacy}","received_events_url":"https://api.github.com/users/rakuco/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T18:07:58Z","updated_at":"2015-09-04T18:07:58Z","body":"ping @lincsoon \r\nAs I said in #3220, my idea was to land as much of the code there as possible into master to make the final _next_ patch smaller as well as make it clear that this change is important.\r\nPlease take a look."}}