Don't execute middleware in non-mwv environments

Change-Id: Ifd67fc9e8be94e52df97091055d15f00d1443ac4
Bug: 67974