{"action":"created","issue":{"url":"https://api.github.com/repos/robolectric/robolectric/issues/2122","labels_url":"https://api.github.com/repos/robolectric/robolectric/issues/2122/labels{/name}","comments_url":"https://api.github.com/repos/robolectric/robolectric/issues/2122/comments","events_url":"https://api.github.com/repos/robolectric/robolectric/issues/2122/events","html_url":"https://github.com/robolectric/robolectric/pull/2122","id":114415641,"number":2122,"title":"Nanosecond scheduler and ShadowSystemClock fixes (take 2)","user":{"login":"kriegfrj","id":7224087,"avatar_url":"https://avatars.githubusercontent.com/u/7224087?v=3","gravatar_id":"","url":"https://api.github.com/users/kriegfrj","html_url":"https://github.com/kriegfrj","followers_url":"https://api.github.com/users/kriegfrj/followers","following_url":"https://api.github.com/users/kriegfrj/following{/other_user}","gists_url":"https://api.github.com/users/kriegfrj/gists{/gist_id}","starred_url":"https://api.github.com/users/kriegfrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kriegfrj/subscriptions","organizations_url":"https://api.github.com/users/kriegfrj/orgs","repos_url":"https://api.github.com/users/kriegfrj/repos","events_url":"https://api.github.com/users/kriegfrj/events{/privacy}","received_events_url":"https://api.github.com/users/kriegfrj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-31T15:04:10Z","updated_at":"2015-11-03T04:38:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/robolectric/robolectric/pulls/2122","html_url":"https://github.com/robolectric/robolectric/pull/2122","diff_url":"https://github.com/robolectric/robolectric/pull/2122.diff","patch_url":"https://github.com/robolectric/robolectric/pull/2122.patch"},"body":"This is a second attempt at #2063, also incorporating #2072, and a bunch of javadoc improvements that I have implemented in the light of issue #2118.\r\n\r\nThis includes a couple of breaking changes:\r\n\r\n* `setCurrentTimeMillis()` no longer updates the scheduler clock. As I explained in #2118, this break was necessary to bring it into line with real Android behaviour, where this method sets the wall clock and not the looper clock.\r\n* `setNanoTime()` has become redundant given that the nano clock now slaves directly off of the master scheduler's clock. In my previous attempt I removed it; this time around I have deprecated it instead and made it a noop.\r\n\r\nComments welcome, and if @jongerrish is able to test it on his codebase for any compatibility issues that would be appreciated."},"comment":{"url":"https://api.github.com/repos/robolectric/robolectric/issues/comments/153236674","html_url":"https://github.com/robolectric/robolectric/pull/2122#issuecomment-153236674","issue_url":"https://api.github.com/repos/robolectric/robolectric/issues/2122","id":153236674,"user":{"login":"charlesmunger","id":1119316,"avatar_url":"https://avatars.githubusercontent.com/u/1119316?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesmunger","html_url":"https://github.com/charlesmunger","followers_url":"https://api.github.com/users/charlesmunger/followers","following_url":"https://api.github.com/users/charlesmunger/following{/other_user}","gists_url":"https://api.github.com/users/charlesmunger/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesmunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesmunger/subscriptions","organizations_url":"https://api.github.com/users/charlesmunger/orgs","repos_url":"https://api.github.com/users/charlesmunger/repos","events_url":"https://api.github.com/users/charlesmunger/events{/privacy}","received_events_url":"https://api.github.com/users/charlesmunger/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T04:38:36Z","updated_at":"2015-11-03T04:38:36Z","body":"Interesting - many tests at Google are using ShadowSystemClock.setCurrentTimeMillis as a way to modify the clock during tests. My understanding is that calling SystemClock.setCurrentTimeMillis will fail for all non-system applications, since the SET_TIME permission is listed as signatureOrSystem. One thing we could do to make this behavior rational is to change the `@Implemenation` marked method to throw an exception, and provide another method with equivalent functionality to what it does today."}}