24 lines
1 KiB
Java
24 lines
1 KiB
Java
package androidx.media;
|
|
|
|
import android.content.Context;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.media.MediaSessionManager;
|
|
@RequiresApi(21)
|
|
/* loaded from: classes.dex */
|
|
public class MediaSessionManagerImplApi21 extends MediaSessionManagerImplBase {
|
|
public MediaSessionManagerImplApi21(Context context) {
|
|
super(context);
|
|
this.mContext = context;
|
|
}
|
|
|
|
private boolean hasMediaControlPermission(@NonNull MediaSessionManager.RemoteUserInfoImpl remoteUserInfoImpl) {
|
|
return getContext().checkPermission("android.permission.MEDIA_CONTENT_CONTROL", remoteUserInfoImpl.getPid(), remoteUserInfoImpl.getUid()) == 0;
|
|
}
|
|
|
|
@Override // androidx.media.MediaSessionManagerImplBase, androidx.media.MediaSessionManager.MediaSessionManagerImpl
|
|
public boolean isTrustedForMediaControl(@NonNull MediaSessionManager.RemoteUserInfoImpl remoteUserInfoImpl) {
|
|
return hasMediaControlPermission(remoteUserInfoImpl) || super.isTrustedForMediaControl(remoteUserInfoImpl);
|
|
}
|
|
}
|