FileDocCategorySizeDatePackage
PrinterRegistry.javaAPI DocAndroid 5.1 API6778Thu Mar 12 22:22:42 GMT 2015com.android.printspooler.ui

PrinterRegistry

public class PrinterRegistry extends Object

Fields Summary
private static final int
LOADER_ID_PRINTERS_LOADER
private final android.app.Activity
mActivity
private final List
mPrinters
private final Runnable
mReadyCallback
private final android.os.Handler
mHandler
private boolean
mReady
private OnPrintersChangeListener
mOnPrintersChangeListener
private final android.app.LoaderManager.LoaderCallbacks
mLoaderCallbacks
Constructors Summary
public PrinterRegistry(android.app.Activity activity, Runnable readyCallback)


       
           
          
    

         
        mActivity = activity;
        mReadyCallback = readyCallback;
        mHandler = new MyHandler(activity.getMainLooper());
        activity.getLoaderManager().initLoader(LOADER_ID_PRINTERS_LOADER,
                null, mLoaderCallbacks);
    
Methods Summary
public voidaddHistoricalPrinter(android.print.PrinterInfo printer)

        FusedPrintersProvider provider = getPrinterProvider();
        if (provider != null) {
            getPrinterProvider().addHistoricalPrinter(printer);
        }
    
public booleanareHistoricalPrintersLoaded()

        FusedPrintersProvider provider = getPrinterProvider();
        if (provider != null) {
            return getPrinterProvider().areHistoricalPrintersLoaded();
        }
        return false;
    
public voidforgetFavoritePrinter(android.print.PrinterId printerId)

        FusedPrintersProvider provider = getPrinterProvider();
        if (provider != null) {
            provider.forgetFavoritePrinter(printerId);
        }
    
private FusedPrintersProvidergetPrinterProvider()

        Loader<?> loader = mActivity.getLoaderManager().getLoader(LOADER_ID_PRINTERS_LOADER);
        return (FusedPrintersProvider) loader;
    
public java.util.ListgetPrinters()

        return mPrinters;
    
public booleanisFavoritePrinter(android.print.PrinterId printerId)

        FusedPrintersProvider provider = getPrinterProvider();
        if (provider != null) {
            return provider.isFavoritePrinter(printerId);
        }
        return false;
    
public voidsetOnPrintersChangeListener(com.android.printspooler.ui.PrinterRegistry$OnPrintersChangeListener listener)

        mOnPrintersChangeListener = listener;
    
public voidsetTrackedPrinter(android.print.PrinterId printerId)

        FusedPrintersProvider provider = getPrinterProvider();
        if (provider != null) {
            provider.setTrackedPrinter(printerId);
        }