FileDocCategorySizeDatePackage
IntentBindRecord.javaAPI DocAndroid 5.1 API3960Thu Mar 12 22:22:42 GMT 2015com.android.server.am

IntentBindRecord

public final class IntentBindRecord extends Object
A particular Intent that has been bound to a Service.

Fields Summary
final ServiceRecord
service
The running service.
final Intent.FilterComparison
intent
The intent that is bound.
final android.util.ArrayMap
apps
All apps that have bound to this Intent.
android.os.IBinder
binder
Binder published from service.
boolean
requested
Set when we have initiated a request for this binder.
boolean
received
Set when we have received the requested binder.
boolean
hasBound
Set when we still need to tell the service all clients are unbound.
boolean
doRebind
Set when the service's onUnbind() has asked to be told about new clients.
String
stringName
Constructors Summary
IntentBindRecord(ServiceRecord _service, Intent.FilterComparison _intent)

        service = _service;
        intent = _intent;
    
Methods Summary
intcollectFlags()

        int flags = 0;
        for (int i=apps.size()-1; i>=0; i--) {
            final ArraySet<ConnectionRecord> connections = apps.valueAt(i).connections;
            for (int j=connections.size()-1; j>=0; j--) {
                flags |= connections.valueAt(j).flags;
            }
        }
        return flags;
    
voiddump(java.io.PrintWriter pw, java.lang.String prefix)

      // caching of toString
    
         
        pw.print(prefix); pw.print("service="); pw.println(service);
        dumpInService(pw, prefix);
    
voiddumpInService(java.io.PrintWriter pw, java.lang.String prefix)

        pw.print(prefix); pw.print("intent={");
                pw.print(intent.getIntent().toShortString(false, true, false, false));
                pw.println('}");
        pw.print(prefix); pw.print("binder="); pw.println(binder);
        pw.print(prefix); pw.print("requested="); pw.print(requested);
                pw.print(" received="); pw.print(received);
                pw.print(" hasBound="); pw.print(hasBound);
                pw.print(" doRebind="); pw.println(doRebind);
        for (int i=0; i<apps.size(); i++) {
            AppBindRecord a = apps.valueAt(i);
            pw.print(prefix); pw.print("* Client AppBindRecord{");
                    pw.print(Integer.toHexString(System.identityHashCode(a)));
                    pw.print(' "); pw.print(a.client); pw.println('}");
            a.dumpInIntentBind(pw, prefix + "  ");
        }
    
public java.lang.StringtoString()

        if (stringName != null) {
            return stringName;
        }
        StringBuilder sb = new StringBuilder(128);
        sb.append("IntentBindRecord{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append(' ");
        if ((collectFlags()&Context.BIND_AUTO_CREATE) != 0) {
            sb.append("CR ");
        }
        sb.append(service.shortName);
        sb.append(':");
        if (intent != null) {
            intent.getIntent().toShortString(sb, false, false, false, false);
        }
        sb.append('}");
        return stringName = sb.toString();