* Copyright (C) 2010-2012 Regis Montoya (aka r3gis - www.r3gis.fr)
 * This file is part of ActionBarSherlock2.
 *  CSipSimple is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  If you own a pjsip commercial license you can also redistribute it
 *  and/or modify it under the terms of the GNU Lesser General Public License
 *  as an android library.
 *  CSipSimple is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  GNU General Public License for more details.
 *  You should have received a copy of the GNU General Public License
 *  along with ActionBarSherlock2.  If not, see <http://www.gnu.org/licenses/>.

package com.actionbarsherlock.internal.utils;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.LinearLayout;
import android.widget.PopupWindow;

// 11 is HONEYCOMB
public class Utility11 extends Utility9 {

    public void viewSetActivated(View view, boolean activated) {

    public boolean hasPermanentMenuKey(ViewConfiguration vcfg) {
        return true;
    public void jumpDrawablesToCurrentState(View v) {
    public void jumpToCurrentState(Drawable indeterminateDrawable) {
    public Drawable getActivityLogo(Context context) {
        Drawable mLogo = null;
        ApplicationInfo appInfo = context.getApplicationInfo();
        PackageManager pm = context.getPackageManager();
        if (context instanceof Activity) {
            try {
                mLogo = pm.getActivityLogo(((Activity) context).getComponentName());
            } catch (NameNotFoundException e) {
                Log.e("Utility", "Activity component name not found!", e);
        if (mLogo == null) {
            mLogo = appInfo.loadLogo(pm);
        return mLogo;
    public PopupWindow buildPopupWindow(Context context, AttributeSet attrs, int defStyleAttr,
            int defStyleRes) {
        return new PopupWindow(context, attrs, defStyleAttr, defStyleRes);
    public int resolveSizeAndState(int size, int measureSpec, int state) {
        return View.resolveSizeAndState(size, measureSpec, state);

    public int getMeasuredState(View child) {
        return child.getMeasuredState();
    public int combineMeasuredStates(int curState, int newState) {
        return View.combineMeasuredStates(curState, newState);

    public void setLinearLayoutDividerDrawable(LinearLayout l, Drawable d) {
        super.setLinearLayoutDividerDrawable(l, d);