Code example for ComponentName

Methods: getServiceInfo

0
        assertNull("Meta data returned when not requested", ai.metaData);
    } 
 
    @SmallTest 
    public void testServiceWithData() throws Exception { 
        ComponentName cn = new ComponentName(mContext, LocalService.class);
        ServiceInfo si = mContext.getPackageManager().getServiceInfo(
                cn, PackageManager.GET_META_DATA);
 
        checkMetaData(cn, si);
 
        si = mContext.getPackageManager().getServiceInfo(cn, 0);
 
        assertNull("Meta data returned when not requested", si.metaData);
    } 
 
    @MediumTest 
    public void testProviderWithData() throws Exception { 
        ComponentName cn = new ComponentName(mContext, LocalProvider.class);
        ProviderInfo pi = mContext.getPackageManager().resolveContentProvider(
                "com.android.unit_tests.LocalProvider",