Just imagine the following. The Shanghai deal keeps the production going until the USAF order the tankers. After Shanghai takes delivery of the 787 Boeing buys back the 767, which are then converted to tankers for the USAF and could be sold cheaper then the new builts, which would reduce the price of the USAF contract.
A win win situation for both sides.