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

Change-Id: Ieb520cb1254421149fa9e035a2a2b1490dfba649