// LGE_WCDMA_FEATURE_MERGE START
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// LGE_MPDP START
package com.android.settings;
import android.content.Context;
import android.content.ContentUris;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.preference.Preference;
import android.provider.Telephony;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
public class QosPreference extends Preference implements OnClickListener {
final static String TAG = "QosPreference";
/**
* @param context
* @param attrs
* @param defStyle
*/
public QosPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
/**
* @param context
* @param attrs
*/
public QosPreference(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
/**
* @param context
*/
public QosPreference(Context context) {
super(context);
init();
}
@Override
public View getView(View convertView, ViewGroup parent) {
View view = super.getView(convertView, parent);
View textLayout = view.findViewById(R.id.text_layout);
if ((textLayout != null) && textLayout instanceof RelativeLayout) {
textLayout.setOnClickListener(this);
}
return view;
}
private void init() {
setLayoutResource(R.layout.qos_preference_layout);
}
public void onClick(View v) {
if ((v != null) && (R.id.text_layout == v.getId())) {
Context context = getContext();
if (context != null) {
int pos = Integer.parseInt(getKey());
Log.i(TAG, "onClick:pos = "+pos);
Uri url = ContentUris.withAppendedId(Telephony.QoSProfileColumns.CONTENT_URI, pos);
context.startActivity(new Intent(Intent.ACTION_EDIT, url));
}
}
}
}
// LGE_MPDP END
// LGE_WCDMA_FEATURE_MERGE END