michael@0: /* michael@0: * Copyright (C) 2013 Square, Inc. michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: package com.squareup.picasso; michael@0: michael@0: import android.net.ConnectivityManager; michael@0: import android.net.NetworkInfo; michael@0: import android.telephony.TelephonyManager; michael@0: import java.util.concurrent.LinkedBlockingQueue; michael@0: import java.util.concurrent.ThreadPoolExecutor; michael@0: import java.util.concurrent.TimeUnit; michael@0: michael@0: /** michael@0: * The default {@link java.util.concurrent.ExecutorService} used for new {@link Picasso} instances. michael@0: *
michael@0: * Exists as a custom type so that we can differentiate the use of defaults versus a user-supplied michael@0: * instance. michael@0: */ michael@0: class PicassoExecutorService extends ThreadPoolExecutor { michael@0: private static final int DEFAULT_THREAD_COUNT = 3; michael@0: michael@0: PicassoExecutorService() { michael@0: super(DEFAULT_THREAD_COUNT, DEFAULT_THREAD_COUNT, 0, TimeUnit.MILLISECONDS, michael@0: new LinkedBlockingQueue