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

Commit 0bb0b2c1 authored by Hall Liu's avatar Hall Liu Committed by Automerger Merge Worker
Browse files

Merge "Fix Telecom log traces" into rvc-dev am: e986de64 am: 946ea069 am: 05fd6d9e

Change-Id: I1f219ff459235d6becc107f8a2ff7286e7f12f0f
parents 616174e0 05fd6d9e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -148,6 +148,8 @@ public class IncomingCallFilterGraph {
                CompletableFuture.completedFuture(input);
        PostFilterTask postFilterTask = new PostFilterTask(filter);

        // TODO: improve these filter logging names to be more reflective of the filters that are
        // executing
        startFuture.thenComposeAsync(filter::startFilterLookup,
                new LoggedHandlerExecutor(mHandler, "ICFG.sF", null))
                .thenApplyAsync(postFilterTask::whenDone,
+71 −51
Original line number Diff line number Diff line
@@ -66,12 +66,17 @@ public class NewCallScreeningServiceFilter extends CallFilter {
        @Override
        public void allowCall(String callId) {
            Long token = Binder.clearCallingIdentity();
            Log.startSession("NCSSF.aC");
            try {
                if (mCall == null || (!mCall.getId().equals(callId))) {
                    Log.w(this, "allowCall, unknown call id: %s", callId);
                }
                mResultFuture.complete(mPriorStageResult);
            Binder.restoreCallingIdentity(token);
            } finally {
                unbindCallScreeningService();
                Binder.restoreCallingIdentity(token);
                Log.endSession();
            }
        }

        @Override
@@ -79,6 +84,8 @@ public class NewCallScreeningServiceFilter extends CallFilter {
                boolean shouldAddToCallLog, boolean shouldShowNotification,
                ComponentName componentName) {
            long token = Binder.clearCallingIdentity();
            Log.startSession("NCSSF.dC");
            try {
                if (mCall != null && mCall.getId().equals(callId)) {
                    mResultFuture.complete(new CallFilteringResult.Builder()
                            .setShouldAllowCall(false)
@@ -96,13 +103,18 @@ public class NewCallScreeningServiceFilter extends CallFilter {
                    Log.w(this, "disallowCall, unknown call id: %s", callId);
                    mResultFuture.complete(mPriorStageResult);
                }
            Binder.restoreCallingIdentity(token);
            } finally {
                unbindCallScreeningService();
                Log.endSession();
                Binder.restoreCallingIdentity(token);
            }
        }

        @Override
        public void silenceCall(String callId) {
            long token = Binder.clearCallingIdentity();
            Log.startSession("NCSSF.sC");
            try {
                if (mCall != null && mCall.getId().equals(callId)) {
                    mResultFuture.complete(new CallFilteringResult.Builder()
                            .setShouldAllowCall(true)
@@ -116,19 +128,24 @@ public class NewCallScreeningServiceFilter extends CallFilter {
                    Log.w(this, "silenceCall, unknown call id: %s", callId);
                    mResultFuture.complete(mPriorStageResult);
                }
            Binder.restoreCallingIdentity(token);
            } finally {
                unbindCallScreeningService();
                Log.endSession();
                Binder.restoreCallingIdentity(token);
            }
        }

        @Override
        public void screenCallFurther(String callId) {
            long token = Binder.clearCallingIdentity();
            if (mPackagetype != PACKAGE_TYPE_DEFAULT_DIALER) {
                throw new SecurityException("Only the default/system dialer may request screen via"
                    + "background call audio");
            }
            // TODO: add permission check for the additional role-based permission
            long token = Binder.clearCallingIdentity();
            Log.startSession("NCSSF.sCF");

            try {
                if (mCall != null && mCall.getId().equals(callId)) {
                    mResultFuture.complete(new CallFilteringResult.Builder()
                            .setShouldAllowCall(true)
@@ -141,8 +158,11 @@ public class NewCallScreeningServiceFilter extends CallFilter {
                    Log.w(this, "screenCallFurther, unknown call id: %s", callId);
                    mResultFuture.complete(mPriorStageResult);
                }
            Binder.restoreCallingIdentity(token);
            } finally {
                unbindCallScreeningService();
                Log.endSession();
                Binder.restoreCallingIdentity(token);
            }
        }
    }