FileDocCategorySizeDatePackage
PrintOptionUtils.javaAPI DocAndroid 5.1 API2121Thu Mar 12 22:22:42 GMT 2015com.android.printspooler.util

PrintOptionUtils

public class PrintOptionUtils extends Object

Fields Summary
Constructors Summary
private PrintOptionUtils()

        /* ignore - hide constructor */
    
Methods Summary
public static java.lang.StringgetAdvancedOptionsActivityName(android.content.Context context, android.content.ComponentName serviceName)
Gets the advanced options activity name for a print service.

param
context Context for accessing system resources.
param
serviceName The print service name.
return
The advanced options activity name or null.

        PrintManager printManager = (PrintManager) context.getSystemService(
                Context.PRINT_SERVICE);
        List<PrintServiceInfo> printServices = printManager.getEnabledPrintServices();
        final int printServiceCount = printServices.size();
        for (int i = 0; i < printServiceCount; i ++) {
            PrintServiceInfo printServiceInfo = printServices.get(i);
            ServiceInfo serviceInfo = printServiceInfo.getResolveInfo().serviceInfo;
            if (serviceInfo.name.equals(serviceName.getClassName())
                    && serviceInfo.packageName.equals(serviceName.getPackageName())) {
                return printServiceInfo.getAdvancedOptionsActivityName();
            }
        }
        return null;