Code example for Context

Methods: sendBroadcast

0
        // TODO: Should we require a permission? 
        ActivityManagerNative.broadcastStickyIntent(intent, null);
 
        if (isUnplug) {
            intent = new Intent(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
            mContext.sendBroadcast(intent);
        } 
    } 
 
    private synchronized final void updateAudioRoute() { 
        if (mAudioRouteNeedsUpdate) {
            mAudioManager.setWiredHeadsetOn(mHeadsetState > 0);
            mAudioRouteNeedsUpdate = false;
        } 
    } 
 
    private final Handler mHandler = new Handler() {
        @Override 
        public void handleMessage(Message msg) { 
            updateAudioRoute(); 
            mWakeLock.release();