1. 08 Apr, 2016 1 commit
    • Lorenzo Colitti's avatar
      Deduplicate test targets. · 15c35db4
      Lorenzo Colitti authored
      netd_integration_test already runs all the tests in netd_test.
      
      Change-Id: I44c2ffaecded071a54af1c54c823856ffc6eb0cf
      15c35db4
  2. 06 Apr, 2016 3 commits
  3. 31 Mar, 2016 3 commits
  4. 30 Mar, 2016 2 commits
  5. 28 Mar, 2016 2 commits
    • Lorenzo Colitti's avatar
      Move iptables test code to a new IptablesBaseTest class. · 0f15055b
      Lorenzo Colitti authored
      Bug: 25691379
      Bug: 21725996
      Change-Id: Ia0598e60ad24714d53470e05849929831ba9dbf6
      0f15055b
    • Lorenzo Colitti's avatar
      Use iptables-restore in BandwidthController startup. · 13debb89
      Lorenzo Colitti authored
      This saves approximately 800ms on boot.
      
      From the perspective of the rules, this change is a no-op. As the
      unit test shows, the commands are the same, though some are in a
      slightly different order because iptables-restore requires that
      COMMIT be called between different tables (e.g., filter and
      mangle).
      
      For simplicity, enableBandwidthControl runs two iptables-restore
      commands instead of one. This is not semantically different from
      the previous code because the previous code just ran iptables
      commands one by one, which provides no atomicity. Running two
      commands is a bit slower than running one, but it's still much
      faster than using iptables.
      
      Using iptables-restore allows us to do things like ":<chain> -",
      which both creates the chain (if it does not already exist) and
      flushes it. This allows us to remove IPT_CLEANUP_COMMANDS and
      IPT_SETUP_COMMANDS. Those two sets of commands, which basically
      just did "-X bw_<foo>" and "-N bw_<foo>" were only necessary
      because the preceding "-F bw_<foo>" command would not create
      bw_<foo> if it did not already exist (e.g. in setupIptablesHooks,
      which runs on netd startup).
      
      Bug: 21725996
      Change-Id: I6656aed4287dfcb2311c94800f430c143fb0b1a5
      13debb89
  6. 27 Mar, 2016 2 commits
    • Lorenzo Colitti's avatar
      Add more test coverage for BandwidthController. · a0dc8a54
      Lorenzo Colitti authored
      Bug: 25691379
      Bug: 21725996
      Change-Id: I196f568221b3bad98ba2d60e019c2b24c59a9cbc
      a0dc8a54
    • Lorenzo Colitti's avatar
      Attempt to make data saver mode work for real. · 464eabec
      Lorenzo Colitti authored
      The data saver refactoring change was incorrect in >= two ways:
      
      1. It relied on the bw_costly_shared chain, which is currently
         unused. NetworkManagementService just has a "TODO: support
         quota shared across interfaces" comment about it. What
         actually happens when setting quota is that each costly
         interface chain (e.g., bw_costly_rmnet_data0) directly hooks
         in the bw_penalty box chain.
      
      2. Implementing app whitelisting using "RETURN" inside
         bw_happy_box was pointless because if data saver was enabled,
         there was a REJECT at the end of the bw_costly_shared chain
         that it was returning to.
      
      Instead, go back to the previous approach which hooked
      bw_happy_box at the end of bw_penalty_box. Also, add an
      additional bw_data_saver rule at the end of bw_happy_box.
      bw_data_saver only contains one rule: RETURN if data saver is
      enabled or REJECT if data saver is disabled.
      
      That way:
      
      1. If the app is blacklisted, bw_penalty_box REJECTs. If not:
      2. If the app is whitelisted (system apps are always whitelisted)
         bw_happy_box RETURNs to bw_costly_rmnet_data0, skipping
         bw_data_saver.
      3. If an app is neither blacklisted nor whitelisted, bw_happy_box
         jumps to bw_data_saver. If data saver is enabled, it REJECTs
         the packet, and if not, it RETURNs to bw_costly_rmnet_data0.
      4. When we RETURN to bw_costly_rmnet_data0, either because the
         app is whitelisted, or because data saver is off,
         bw_costly_rmnet_data0 applies mobile data usage limits,
         and then RETURNs to bw_OUTPUT, which calls xt_qtaguid, etc.
      
      Bug: 26685616
      Bug: 27506285
      Change-Id: If15397afde6862d95827a1fdd30f60efd7fab66a
      464eabec
  7. 25 Mar, 2016 1 commit
  8. 24 Mar, 2016 1 commit
  9. 23 Mar, 2016 1 commit
  10. 22 Mar, 2016 5 commits
    • Lorenzo Colitti's avatar
      Merge changes I149ccda5,I4457abd4,I67bff7c3,Ie15b0775,I8dd9fc60 into nyc-dev · 7fa41f33
      Lorenzo Colitti authored
      * changes:
        Stop using SIOCKILLADDR in netd.
        Add a rudimentary unit test for BandwidthController.
        Slightly restructure the data saver iptables rules.
        Remove the ability to enable/disable the happy box.
        Don't keep naughty/nice app state in BandwidthController.
      7fa41f33
    • Lorenzo Colitti's avatar
      Stop using SIOCKILLADDR in netd. · 29ca4e04
      Lorenzo Colitti authored
      SOCK_DESTROY is now supported in all N device kernels.
      
      Bug: 26976388
      Change-Id: I149ccda56edacac28602daddb01b5fd0222d5fb0
      29ca4e04
    • Lorenzo Colitti's avatar
      Add a rudimentary unit test for BandwidthController. · 86a47982
      Lorenzo Colitti authored
      Bug: 26685616
      Bug: 27506285
      Change-Id: I4457abd43697a0425f167b81c1432d743800abb8
      86a47982
    • Lorenzo Colitti's avatar
      Slightly restructure the data saver iptables rules. · 7618ccb3
      Lorenzo Colitti authored
      1. Make bw_costly_shared jump to bw_happy_box after
         bw_penalty_box. This allows the framework to manipulate
         whitelists and blacklists independently.
      2. Make bw_happy box always whitelist system apps. Because
         bw_penalty_box is consulted before bw_happy_box, the
         framework can always blacklist certain system apps (e.g.,
         the media server) by putting them in the blacklist.
      3. Add a method to add/remove a reject at the end of
         bw_costly_shared. This will allow the framework to
         enable/disable data saver by changing only one rule.
      
      Bug: 26685616
      Bug: 27506285
      Change-Id: I67bff7c3c9ff5eb3f84fb84550cdf49f153e1b68
      7618ccb3
    • Erik Kline's avatar
      Add initial dump() method to NetdNativeService · 2d3a1634
      Erik Kline authored
      This is called by "dumpsys netd".
      
      Bug: 27239233
      Change-Id: I27fb308f8067243ff241a6f8fd6a83f406087d2a
      2d3a1634
  11. 21 Mar, 2016 1 commit
  12. 18 Mar, 2016 2 commits
  13. 17 Mar, 2016 1 commit
    • Lorenzo Colitti's avatar
      Start NetdNativeService before CommandListener. · e4851ded
      Lorenzo Colitti authored
      Starting CommandListener tells NetworkManagementService that netd
      is ready to accept commands. Ensure that the binder service is
      started (i.e., we have called startThreadPool) before we do this.
      
      Bug: 27239233
      Change-Id: Ica89e72f51eb4752cb5cea2e4096c6a9dc5776d7
      e4851ded
  14. 14 Mar, 2016 2 commits
  15. 09 Mar, 2016 1 commit
  16. 02 Mar, 2016 5 commits
  17. 01 Mar, 2016 1 commit
  18. 26 Feb, 2016 1 commit
  19. 25 Feb, 2016 3 commits
  20. 23 Feb, 2016 2 commits
    • Lorenzo Colitti's avatar
      Rename the netd service from "android.net.INetd" to "netd". · c2c7b755
      Lorenzo Colitti authored
      Bug: 27239233
      Change-Id: I34a5554604e6d8b8a50838c6911c28503cbf4540
      c2c7b755
    • Lorenzo Colitti's avatar
      Initial netd binder interface. · e4d626ea
      Lorenzo Colitti authored
      In this change:
      
      1. AIDL files for a new, android.net.INetd service, and
         corresponding implementation using generated code. For now the
         interface is just a prototype: it only has one trivial method.
      2. Permission checking code to check for CONNECTIVITY_INTERNAL.
      3. Add a Big Netd Lock and provide a wrapper that makes it easy
         to ensure that it is taken by every CommandListener command.
      
      Bug: 27239233
      Change-Id: I448d0ac233edd0e351a7fe7f13901fb6871683a2
      e4d626ea