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

Commit 0528d386 authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by Steve Kondik
Browse files

http: customizable idle cache size

Make idle cache size customizable.
Introduce system property "http.idle_cache.size" that evaluated
on the framework load.

Change-Id: I484d2b32f74862364c69d75e9319f3547a4c058f
parent e356eba8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (C) 2011, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -23,6 +24,7 @@ package android.net.http;
import org.apache.http.HttpHost;

import android.os.SystemClock;
import android.os.SystemProperties;

/**
 * {@hide}
@@ -35,7 +37,7 @@ class IdleCache {
        long mTimeout;
    };

    private final static int IDLE_CACHE_MAX = 8;
    private final static int IDLE_CACHE_MAX = SystemProperties.getInt("http.idle_cache.size", 8);

    /* Allow five consecutive empty queue checks before shutdown */
    private final static int EMPTY_CHECK_MAX = 5;