Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -9572,6 +9572,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { * A maximum of 1200 events are returned, and the total marshalled size is in the order of * 100kB, so returning a List instead of ParceledListSlice is acceptable. * Ideally this would be done with ParceledList, however it only supports homogeneous types. * * @see NetworkLoggingHandler#MAX_EVENTS_PER_BATCH */ @Override public synchronized List<NetworkEvent> retrieveNetworkLogs(ComponentName admin, Loading services/devicepolicy/java/com/android/server/devicepolicy/NetworkLoggingHandler.java +5 −4 Original line number Diff line number Diff line Loading @@ -61,8 +61,9 @@ final class NetworkLoggingHandler extends Handler { @GuardedBy("this") private ArrayList<NetworkEvent> mFullBatch; // each full batch is represented by its token, which the DPC has to provide back to revieve it @GuardedBy("this") private long currentFullBatchToken; private long mCurrentFullBatchToken; NetworkLoggingHandler(Looper looper, DevicePolicyManagerService dpm) { super(looper); Loading Loading @@ -101,9 +102,9 @@ final class NetworkLoggingHandler extends Handler { scheduleBatchFinalization(BATCH_FINALIZATION_TIMEOUT_MS); // notify DO that there's a new non-empty batch waiting if (mFullBatch.size() > 0) { currentFullBatchToken++; mCurrentFullBatchToken++; Bundle extras = new Bundle(); extras.putLong(DeviceAdminReceiver.EXTRA_NETWORK_LOGS_TOKEN, currentFullBatchToken); extras.putLong(DeviceAdminReceiver.EXTRA_NETWORK_LOGS_TOKEN, mCurrentFullBatchToken); extras.putInt(DeviceAdminReceiver.EXTRA_NETWORK_LOGS_COUNT, mFullBatch.size()); mDpm.sendDeviceOwnerCommand(DeviceAdminReceiver.ACTION_NETWORK_LOGS_AVAILABLE, extras); } else { Loading @@ -112,7 +113,7 @@ final class NetworkLoggingHandler extends Handler { } synchronized List<NetworkEvent> retrieveFullLogBatch(long batchToken) { if (batchToken != currentFullBatchToken) { if (batchToken != mCurrentFullBatchToken) { return null; } return mFullBatch; Loading Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -9572,6 +9572,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { * A maximum of 1200 events are returned, and the total marshalled size is in the order of * 100kB, so returning a List instead of ParceledListSlice is acceptable. * Ideally this would be done with ParceledList, however it only supports homogeneous types. * * @see NetworkLoggingHandler#MAX_EVENTS_PER_BATCH */ @Override public synchronized List<NetworkEvent> retrieveNetworkLogs(ComponentName admin, Loading
services/devicepolicy/java/com/android/server/devicepolicy/NetworkLoggingHandler.java +5 −4 Original line number Diff line number Diff line Loading @@ -61,8 +61,9 @@ final class NetworkLoggingHandler extends Handler { @GuardedBy("this") private ArrayList<NetworkEvent> mFullBatch; // each full batch is represented by its token, which the DPC has to provide back to revieve it @GuardedBy("this") private long currentFullBatchToken; private long mCurrentFullBatchToken; NetworkLoggingHandler(Looper looper, DevicePolicyManagerService dpm) { super(looper); Loading Loading @@ -101,9 +102,9 @@ final class NetworkLoggingHandler extends Handler { scheduleBatchFinalization(BATCH_FINALIZATION_TIMEOUT_MS); // notify DO that there's a new non-empty batch waiting if (mFullBatch.size() > 0) { currentFullBatchToken++; mCurrentFullBatchToken++; Bundle extras = new Bundle(); extras.putLong(DeviceAdminReceiver.EXTRA_NETWORK_LOGS_TOKEN, currentFullBatchToken); extras.putLong(DeviceAdminReceiver.EXTRA_NETWORK_LOGS_TOKEN, mCurrentFullBatchToken); extras.putInt(DeviceAdminReceiver.EXTRA_NETWORK_LOGS_COUNT, mFullBatch.size()); mDpm.sendDeviceOwnerCommand(DeviceAdminReceiver.ACTION_NETWORK_LOGS_AVAILABLE, extras); } else { Loading @@ -112,7 +113,7 @@ final class NetworkLoggingHandler extends Handler { } synchronized List<NetworkEvent> retrieveFullLogBatch(long batchToken) { if (batchToken != currentFullBatchToken) { if (batchToken != mCurrentFullBatchToken) { return null; } return mFullBatch; Loading