mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-25 20:37:40 +00:00 
			
		
		
		
	Fix SonarLint java:S5320, restrict broadcasts to app package
This commit is contained in:
		| @@ -57,6 +57,7 @@ import com.google.android.exoplayer2.ui.AspectRatioFrameLayout; | |||||||
| import com.google.android.exoplayer2.ui.CaptionStyleCompat; | import com.google.android.exoplayer2.ui.CaptionStyleCompat; | ||||||
| import com.google.android.exoplayer2.video.VideoSize; | import com.google.android.exoplayer2.video.VideoSize; | ||||||
|  |  | ||||||
|  | import org.schabi.newpipe.App; | ||||||
| import org.schabi.newpipe.R; | import org.schabi.newpipe.R; | ||||||
| import org.schabi.newpipe.databinding.PlayerBinding; | import org.schabi.newpipe.databinding.PlayerBinding; | ||||||
| import org.schabi.newpipe.extractor.MediaFormat; | import org.schabi.newpipe.extractor.MediaFormat; | ||||||
| @@ -1372,7 +1373,9 @@ public abstract class VideoPlayerUi extends PlayerUi | |||||||
|         } else if (v.getId() == binding.switchMute.getId()) { |         } else if (v.getId() == binding.switchMute.getId()) { | ||||||
|             player.toggleMute(); |             player.toggleMute(); | ||||||
|         } else if (v.getId() == binding.playerCloseButton.getId()) { |         } else if (v.getId() == binding.playerCloseButton.getId()) { | ||||||
|             context.sendBroadcast(new Intent(VideoDetailFragment.ACTION_HIDE_MAIN_PLAYER)); |             // set package to this app's package to prevent the intent from being seen outside | ||||||
|  |             context.sendBroadcast(new Intent(VideoDetailFragment.ACTION_HIDE_MAIN_PLAYER) | ||||||
|  |                     .setPackage(App.PACKAGE_NAME)); | ||||||
|         } else if (v.getId() == binding.playbackSpeed.getId()) { |         } else if (v.getId() == binding.playbackSpeed.getId()) { | ||||||
|             onPlaybackSpeedClicked(); |             onPlaybackSpeedClicked(); | ||||||
|         } else if (v.getId() == binding.qualityTextView.getId()) { |         } else if (v.getId() == binding.qualityTextView.getId()) { | ||||||
|   | |||||||
| @@ -25,6 +25,7 @@ import androidx.core.graphics.drawable.DrawableCompat; | |||||||
| import androidx.preference.Preference; | import androidx.preference.Preference; | ||||||
| import androidx.preference.PreferenceViewHolder; | import androidx.preference.PreferenceViewHolder; | ||||||
|  |  | ||||||
|  | import org.schabi.newpipe.App; | ||||||
| import org.schabi.newpipe.R; | import org.schabi.newpipe.R; | ||||||
| import org.schabi.newpipe.databinding.ListRadioIconItemBinding; | import org.schabi.newpipe.databinding.ListRadioIconItemBinding; | ||||||
| import org.schabi.newpipe.databinding.SingleChoiceDialogViewBinding; | import org.schabi.newpipe.databinding.SingleChoiceDialogViewBinding; | ||||||
| @@ -62,7 +63,9 @@ public class NotificationActionsPreference extends Preference { | |||||||
|     public void onDetached() { |     public void onDetached() { | ||||||
|         super.onDetached(); |         super.onDetached(); | ||||||
|         saveChanges(); |         saveChanges(); | ||||||
|         getContext().sendBroadcast(new Intent(ACTION_RECREATE_NOTIFICATION)); |         // set package to this app's package to prevent the intent from being seen outside | ||||||
|  |         getContext().sendBroadcast(new Intent(ACTION_RECREATE_NOTIFICATION) | ||||||
|  |                 .setPackage(App.PACKAGE_NAME)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox