Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d0e0f14 authored by Dongwon Kang's avatar Dongwon Kang
Browse files

Allow system settings to update TvInputInfo

Bug: 31637593
Test: build & boot, no crash on settings
Change-Id: Idbf3663bd4f1f2a47d6f211b8dc10bc08002d150
parent 017f1dc5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -915,7 +915,11 @@ public final class TvInputManagerService extends SystemService {
        public void updateTvInputInfo(TvInputInfo inputInfo, int userId) {
            String inputInfoPackageName = inputInfo.getServiceInfo().packageName;
            String callingPackageName = getCallingPackageName();
            if (!TextUtils.equals(inputInfoPackageName, callingPackageName)) {
            if (!TextUtils.equals(inputInfoPackageName, callingPackageName)
                    && mContext.checkCallingPermission(
                            android.Manifest.permission.WRITE_SECURE_SETTINGS)
                                    != PackageManager.PERMISSION_GRANTED) {
                // Only the app owning the input and system settings are allowed to update info.
                throw new IllegalArgumentException("calling package " + callingPackageName
                        + " is not allowed to change TvInputInfo for " + inputInfoPackageName);
            }