Create writer and handle environment variable am: 6d7cb59052
am: 37b436b189

Change-Id: I68a7e94af78bdedf58d31762b10cb6aae399c5d4