title: BroadcastReceivers in ICS
body: <p>I had written a small utility app just for my phone, which stopped the annoying carrier provided jingle which played on boot up. I noticed the sound didn't play if I put the phone into silent mode before powering off, so I wrote this little utility to go silent on power down and restore sound on boot. This worked well for a Galaxy S2 on Gingerbread. The entire code is in two classes:</p>
  
  <pre><code>public class OnShutDownReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          AudioManager mgr=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
          mgr.setRingerMode(AudioManager.RINGER_MODE_SILENT);
      }
  
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public class OnBootReceiver extends BroadcastReceiver {
  
    @Override
    public void onReceive(Context context, Intent intent) {
        AudioManager mgr=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
        mgr.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
    }
  }
  </code></pre>
  
  <p>The manifest is</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.nbt.hush"
      android:versionCode="1"
      android:versionName="1.0" &gt;
      &lt;uses-sdk android:minSdkVersion="7" /&gt;
      &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
          &lt;receiver android:name=".OnBootReceiver" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
           &lt;receiver android:name=".OnShutDownReceiver" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.ACTION_SHUTDOWN" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Now my phone has been upgraded to ICS by my carrier, it no longer works. If I put the phone into silent mode before powering down, the jingle doesn't play. Therefore I suspect that neither receiver is triggered. (I did put some log code in the receivers which didn't show up, but I suspect that because of the timings it might not have been displayed under Gingerbread either.)</p>
  
  <p>Any suggestions please as to why it won't work anymore?</p>