title: Android Wear OS - AmbientModeSupport not working properly in release-mode
body: <p>I'm using AmbientModeSupport for an Androi Wear OS application: <a href="https://developer.android.com/training/wearables/overlays/always-on" rel="nofollow noreferrer">https://developer.android.com/training/wearables/overlays/always-on</a></p>
  <p>Just finished implementing/testing it and everything worked as expected.
  After app release I noticed that the feature is not working properly when the app is downloaded from Google Play.</p>
  <p>I did some extra testing and:</p>
  <ul>
  <li>Everything works if app is installed in debug-mode.</li>
  <li>The Ambient feature is not working well if app is installed in release-mode.</li>
  </ul>
  <p>In release-mode, the screen just lowers it's brightness, but there are no changes on the UI (changes performed in <em>onEnterAmbient</em>).
  The WAKE_LOCK permission is already provided in AndroidManifest:</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;
  </code></pre>
  <p>Any ideas?</p>
  <hr />
  <p><strong>UPDATE:</strong>
  After I thought I'm completely out of ideas, I realized that my build.gradle has 2 extra things for the release-mode, the proguard and the minify flags:</p>
  <pre><code>buildTypes {
      release {
          minifyEnabled true
          proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
  }
  </code></pre>
  <p>It seems that the <em>minifyEnabled</em> caused the problem. I don't know why this behavior occured, but the Ambient Mode is working if I remove the <em>minifyEnabled</em> flag.</p>