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

Commit 259732a8 authored by Rubin Xu's avatar Rubin Xu
Browse files

Fix dpm force-network-logs

A new permission check in AlarmManager means that we need to clear caller
identity before calling into mNetworkLogger.forceBatchFinalization to
force network logs.

Bug: 123028500
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation
Change-Id: I62a9473fa4ec5493a3db4fdad3469e46737fadc0
parent be09f280
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -12995,7 +12995,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                throw new IllegalStateException("logging is not available");
            }
            if (mNetworkLogger != null) {
                final long ident = mInjector.binderClearCallingIdentity();
                try {
                    return mNetworkLogger.forceBatchFinalization();
                } finally {
                    mInjector.binderRestoreCallingIdentity(ident);
                }
            }
            return 0;
        }