Skip to content
Snippets Groups Projects
  1. Feb 07, 2024
  2. Feb 06, 2024
  3. Feb 05, 2024
  4. Feb 04, 2024
  5. Feb 03, 2024
  6. Feb 02, 2024
  7. Feb 01, 2024
    • Kangping Dong's avatar
    • Kangping Dong's avatar
      [Thread] restarts when ot-daemon crashes · 3deddc7b
      Kangping Dong authored
      This commit handles the ot-daemon crash by automatically restarting it
      and rejoin the network if ever joined.
      
      This also fixes the address not deleted issue in TunInterfaceContorller.
      
      Bug: 321540728
      Bug: 309792480
      Change-Id: I3ed466eb70818974a1e57f01456363bdf82915d5
      3deddc7b
    • Remi NGUYEN VAN's avatar
    • Remi NGUYEN VAN's avatar
      Initialize serviceCache before first use · 578e0dc6
      Remi NGUYEN VAN authored
      The comment that "The very first posted task is to initialize the
      service cache, so it will be always set in other tasks running on
      the handler" did not consider that if the looper was provided by the
      caller, it is possible for other tasks to run on it before the
      serviceCache is initialized. In particular, if the caller calls
      registerListener on the looper thread right after calling the
      constructor, this would be executed before the posted initialization
      task.
      
      In practice this does not happen as MdnsDiscoveryManager is created in
      the NsdService constructor, and any usage of it is on messages posted to
      the NsdService handler thread after the constructor has been called; so
      the service cache initialization does happen before any other
      MdnsDiscoveryManager task.
      
      As this is error-prone, just initialize the service cache before first
      use on the handler thread, as it is only used for
      createServiceTypeClient, which runs on the handler thread.
      
      Test: atest
      Change-Id: Ie341bb71ef327dceb4f0aa6fc2d241d6e9cbb900
      578e0dc6
    • Remi NGUYEN VAN's avatar
    • Junyu Lai's avatar
      Rename check*Permission* to has*Permission · 71b51538
      Junyu Lai authored
      The check*Permission methods are a bit error-prone because people
      can forget to check the return value and expect that they behave
      like the enforce* methods. This was pointed out before in some bugs.
      
      This change adds @CheckResult annotation to enforce linter warning
      and rename methods accordingly.
      
      Test: TH
      Fix: 279691948
      Change-Id: Ibb0df6540fe0ed40289bb190b790130daaa2f763
      71b51538
    • Remi NGUYEN VAN's avatar
    • Remi NGUYEN VAN's avatar
      Do not block for HandlerThread start · 97d28b3d
      Remi NGUYEN VAN authored
      Instead of calling HandlerThread#getLooper immediately after starting
      it, do it asynchronously in onLooperPrepared.
      
      getLooper blocks until the looper is ready, which may take a significant
      amount of time.
      
      This involves queueing tasks until the looper is ready, so the thread
      selection logic is refactored to a dedicated class.
      
      Test: atest
      Change-Id: I0444bffe8e4bb4e3f29bd0271c7b24bc46a62cf6
      97d28b3d
    • Yang Sun's avatar
      Add netlinkSocketForProto() without buffersize. · 1d8b7cc4
      Yang Sun authored
      Test: atest NetworkStaticLibTests
      atest FrameworksNetTests
      
      Change-Id: I34a0a29eb7e78490701872229585e61f7a0c1dd3
      1d8b7cc4
    • Maciej Żenczykowski's avatar
  8. Jan 31, 2024
  9. Jan 30, 2024
    • Yang Sun's avatar
      Pass buffer size to NetlinkUtils.netlinkSocketForProto · 7934241c
      Yang Sun authored
      Pass buffer size to netlinkSocketForProto to allow callers to specify
      buffer size. The buffer size is not set if 0 is passed in.
      
      Following callers of netlinkSocketForProto passes SOCKET_RECV_BUFFERSIZE
      to keep same behavior as before:
       * OffloadHardwareInterface.createConntrackSocket()
       * NetlinkUtils.sendOneShotKernelMessage()
       * IpSecXfrmController.Dependencies.newNetlinkSocket()
       * InetDiagMessage.getConnectionOwnerUid()
      Following callers pass 0 to not update the buffer size:
       * TunInterfaceController - it uses the socket only for writing
       * NetlinkUtils.createNetLinkInetDiagSocket() same behavior as before
      Added a SOCKET_DUMP_RECV_BUFFERSIZE of 128k to be used by socket
      requesting dump information from kernel:
       * NetlinkUtils.getAndProcessNetlinkDumpMessages() - sends dump request
         and expecting multiple reply messages.
      
      Bug: 320420453
      
      Test: atest NetworkStaticLibTests
      atest FrameworksNetTests
      
      Change-Id: I3dcb76963cf2646eb311602b50ab4e44b8ad3e8f
      7934241c
    • Handa Wang's avatar
    • Remi NGUYEN VAN's avatar
Loading