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

Commit ba57e578 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Change permission check for two Telecom shell commands.

They relied on IS_USERDEBUG checks which is not a security check; changed
to check for shell instead.

These shell commands are NOT actually used in CTS or anywhere, just as
a part of manual testing.

Test: Manual test.
Flag: EXEMPT trivial code refactor.
Fixes: 308210871
Change-Id: I0b6ccd890101eaf6d5d1d241ac311a4c4c7b3bae
parent 11242d1a
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -2846,9 +2846,7 @@ public class TelecomServiceImpl {
            try {
                Log.startSession("TSI.sTDCRA");
                enforceModifyPermission();
                if (!Build.IS_USERDEBUG) {
                    throw new SecurityException("Test-only API.");
                }
                enforceShellOnly(Binder.getCallingUid(), "Test-only API");
                synchronized (mLock) {
                    long token = Binder.clearCallingIdentity();
                    try {
@@ -2868,9 +2866,7 @@ public class TelecomServiceImpl {
            try {
                Log.startSession("TSI.sTDCSA");
                enforceModifyPermission();
                if (!Build.IS_USERDEBUG) {
                    throw new SecurityException("Test-only API.");
                }
                enforceShellOnly(Binder.getCallingUid(), "Test-only API");
                synchronized (mLock) {
                    long token = Binder.clearCallingIdentity();
                    try {