Skip to content

Commit

Permalink
libmedia: Add MediaPlayer() function for backward compatibility
Browse files Browse the repository at this point in the history
 * package name argument got added to MediaPlayer in fd90fdf, which
   broke most prebuilt libcameraservice as they were built before
   this commit was merged

 * although a shim for this exists, it doesn't work well and
   crashes cameraservice whenever MediaPlayer() is called, seemingly
   due to a stack corruption

Change-Id: I1f8e112b1ab9cc96cb877dbee14767c28a377ab1
  • Loading branch information
adithya2306 authored and NurKeinNeid committed Apr 17, 2021
1 parent b5b146d commit fc9862b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion media/libmedia/include/media/mediaplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ class MediaPlayer : public BnMediaPlayerClient,
public virtual IMediaDeathNotifier
{
public:
MediaPlayer(const std::string opPackageName = "");
MediaPlayer();
MediaPlayer(const std::string opPackageName);
~MediaPlayer();
void died();
void disconnect();
Expand Down
4 changes: 4 additions & 0 deletions media/libmedia/mediaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ namespace android {

using media::VolumeShaper;

MediaPlayer::MediaPlayer() : MediaPlayer("" /*opPackageName*/)
{
}

MediaPlayer::MediaPlayer(const std::string opPackageName) : mOpPackageName(opPackageName)
{
ALOGV("constructor");
Expand Down

0 comments on commit fc9862b

Please sign in to comment.