Skip to content
Snippets Groups Projects
  1. Oct 21, 2021
  2. Oct 20, 2021
  3. Oct 19, 2021
    • William Escande's avatar
      Fix queryRawContactEntity api · 5b4de494
      William Escande authored
      Bug: 203535224
      Tag: #refactor
      Test: build
      Change-Id: Id2e4be7a7985c47e81b6bafee5c35d0df3f33d8f
      5b4de494
    • Treehugger Robot's avatar
      Merge changes I6d3584f3,Ifdaada39 · f637a0d6
      Treehugger Robot authored
      * changes:
        Fix SntpClient 2036 issue (2/2)
        Fix SntpClient 2036 issue (1/2)
      f637a0d6
    • Neil Fuller's avatar
      Fix error prone warnings · a0db5578
      Neil Fuller authored
      Fix warnings introduced by previous commits and add @RunWith annotation
      to new tests for consistency with existing tests.
      
      Bug: 199481251
      Test: Treehugger only
      Change-Id: Iaec4caa80b15112bce84268adc6d763198f0ff61
      a0db5578
    • Neil Fuller's avatar
      Fix SntpClient 2036 issue (2/2) · c9bbe6b5
      Neil Fuller authored
      Fix issue with SntpClient after the end of NTP era 0 (2036).
      
      This is the second of two commits. This commit makes the actual fixes
      and makes tests pass.
      
      Before this change SntpClient converted to Unix epoch times too eagerly.
      NTP 64-bit timestamps are lossy: they only hold the number of seconds /
      factions of seconds in the NTP era and the era is not transmitted. The
      existing code assumed the era was always era 0, which ends in 2036.
      
      As explained at https://www.eecis.udel.edu/~mills/y2k.html,
      the lossiness of the type is not an issue providing that the maths is
      implemented carefully: the NTP timestamps are only ever subtracted from
      each other, are always assumed to be in the same or adjacent NTP eras,
      and are used to calculate offsets that are applied to client Unix epoch
      times.
      
      This commit:
      
      + Switches to use a dedicated Timestamp64 type, avoiding the use
      of the Unix epoch.
      + Switches to use a dedicated Duration64 type for holding the
      32-bit signed difference between two Timestamp64 instances.
      + Simplifies the readTimeStamp() and writeTimeStamp() methods.
      + Adds missing validation covered by a TODO. The code was randomizing
      the lower bits of the client transmit timestamp, but then not checking
      the result as it should, presumably because it was difficult to know
      what value was sent. Easily fixed with a dedicated type.
      + Stops randomizing the lower bits of various other timestamps
      unnecessarily.
      + Fixes some naming to add clarity.
      
      Bug: 199481251
      Test: atest core/tests/coretests/src/android/net/sntp/Timestamp64Test.java
      Test: atest core/tests/coretests/src/android/net/sntp/Duration64Test.java
      Test: atest core/tests/coretests/src/android/net/SntpClientTest.java
      Merged-In: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
      Change-Id: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
      c9bbe6b5
    • Neil Fuller's avatar
      Fix SntpClient 2036 issue (1/2) · f663ab42
      Neil Fuller authored
      Fix issue with SntpClient after the end of NTP era 0 (2036).
      
      This commit is 1/2. It makes some refactoring changes, lint fixes, adds
      tests and introduces types that will be used in 2/2. Some of the added
      tests fail and demonstrate the issue being fixed with the current
      implementation.
      
      -----
      
      Failures that demonstrate the bug:
      
      android.net.SntpClientTest#testRequestTime_era1ClientEra1Server
      
      STACKTRACE:
      junit.framework.AssertionFailedError: expected=5, actual=-4294967295995, allowedSlop=1
      	at junit.framework.Assert.fail(Assert.java:50)
      	at junit.framework.Assert.assertTrue(Assert.java:20)
      	at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502)
      	at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215)
      	at android.net.SntpClientTest.testRequestTime_era1ClientEra1Server(SntpClientTest.java:201)
      
      android.net.SntpClientTest#testRequestTime_era0ClientEra1Server: FAILED (145ms)
      
      STACKTRACE:
      junit.framework.AssertionFailedError: expected=1139293696005, actual=-3155673599995, allowedSlop=1
      	at junit.framework.Assert.fail(Assert.java:50)
      	at junit.framework.Assert.assertTrue(Assert.java:20)
      	at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502)
      	at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215)
      	at android.net.SntpClientTest.testRequestTime_era0ClientEra1Server(SntpClientTest.java:174)
      
      android.net.SntpClientTest#testNonMatchingOriginateTime: FAILED (116ms)
      
      STACKTRACE:
      junit.framework.AssertionFailedError
      	at junit.framework.Assert.fail(Assert.java:48)
      	at junit.framework.Assert.assertTrue(Assert.java:20)
      	at junit.framework.Assert.assertFalse(Assert.java:34)
      	at junit.framework.Assert.assertFalse(Assert.java:41)
      	at android.net.SntpClientTest.testNonMatchingOriginateTime(SntpClientTest.java:384)
      
      ------
      
      This commit:
      
      + Introduces a dedicated Timestamp64 type + test for holding NTP
      timestamps.
      + Introduces a dedicated Duration64 type + test for holding the
      32-bit signed difference between two Timestamp64 instances.
      + Fixes some naming to add clarity / addresses lint issues.
      + Adjusts tests
      
      Tests are NOT expected to pass with just this commit. See 2/2.
      
      Bug: 199481251
      Test: atest core/tests/coretests/src/android/net/sntp/Timestamp64Test.java
      Test: atest core/tests/coretests/src/android/net/sntp/Duration64Test.java
      Test: atest core/tests/coretests/src/android/net/SntpClientTest.java
      Merged-In: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
      Change-Id: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
      f663ab42
    • Ian Hua's avatar
      Merge "Add nnapi_native flag namespace." · bae244dd
      Ian Hua authored
      bae244dd
    • Neil Fuller's avatar
      Add android.net tests to postsubmit · 563ecfcc
      Neil Fuller authored
      Add android.net tests to postsubmit. The tests / annotations will
      be added in a separate commit.
      
      Bug: 199481251
      Test: Treehugger / inspection
      Change-Id: I17cb464979535c767bbb8ee22fd7456ff08bae6c
      563ecfcc
    • Treehugger Robot's avatar
    • wescande's avatar
      AbsoluteVolume change custom call to official API · e312b160
      wescande authored
      BT mainline effort to remove hidden api:
      `avrcpSupportsAbsoluteVolume` only inform for a new volume behavior and
      AudioManager already provide such method.
      
      Bug: 190422401
      Tag: #refactor
      Test: Manual: Start bluetooth, play music and change volume from speaker/phone
      Change-Id: I935df5e0f5632cd4144343bdb1bc2b9d7bc61c01
      e312b160
    • Jakub Pawlowski's avatar
      10d9b01f
  4. Oct 18, 2021
  5. Oct 16, 2021
  6. Oct 15, 2021
Loading