和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518
以下内容为反编译后的 CloudContactDetailActivity.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.cloudserver;
import android.R;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.alumni.model.AlumniCard;
import com.chinamobile.contacts.im.data.ContactAccessor;
import com.chinamobile.contacts.im.data.MediaPlatformDBManager;
import com.chinamobile.contacts.im.jni.Jni;
import com.chinamobile.contacts.im.setting.BrowserActivity;
import com.chinamobile.contacts.im.ui.ICloudActivity;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.chinamobile.contacts.im.view.ListDialog;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBar;
import com.huawei.mcs.auth.data.AASConstants;
import com.huawei.mcs.cloud.msg.base.mms.Telephony;
import com.leadtone.gegw.aoi.protocol.IAoiMessage;
import com.umeng.analytics.AspMobclickAgent;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
public final class CloudContactDetailActivity extends ICloudActivity implements TextWatcher, View.OnClickListener, View.OnFocusChangeListener {
private static com.chinamobile.contacts.im.contacts.c.p Y;
public static int f1579a;
private static final File j = new File(Environment.getExternalStorageDirectory() + "/DCIM/Camera");
private LinearLayout A;
private LinearLayout B;
private LinearLayout C;
private LinearLayout D;
private LinearLayout E;
private LinearLayout F;
private LayoutInflater G;
private IcloudActionBar J;
private ContentResolver K;
private Context aa;
String c;
String d;
String e;
String f;
int g;
int h;
private File k;
private boolean l;
private Uri m;
private Bitmap n;
private TextView p;
private TextView q;
private TextView r;
private TextView s;
private ImageView t;
private ImageView u;
private ViewGroup v;
private LinearLayout w;
private LinearLayout x;
private LinearLayout y;
private LinearLayout z;
private boolean o = false;
private boolean H = false;
private boolean I = false;
private ArrayList<h> L = new ArrayList<>();
private ArrayList<h> M = new ArrayList<>();
private ArrayList<h> N = new ArrayList<>();
private ArrayList<h> O = new ArrayList<>();
private ArrayList<h> P = new ArrayList<>();
private ArrayList<h> Q = new ArrayList<>();
private ArrayList<h> R = new ArrayList<>();
private ArrayList<h> S = new ArrayList<>();
private ArrayList<h> T = new ArrayList<>();
private ArrayList<h> U = new ArrayList<>();
private ArrayList<h> V = new ArrayList<>();
private ArrayList<ArrayList<h>> W = new ArrayList<>();
private String X = "请检查网络配置";
private com.chinamobile.contacts.im.contacts.c.y Z = new com.chinamobile.contacts.im.contacts.c.y();
private DialogInterface.OnClickListener ab = new a(this);
private boolean ac = false;
private boolean ad = false;
private boolean ae = false;
private boolean af = false;
protected Comparator<h> f1580b = new d(this);
String i = "0";
@Override
public void onClick(View view) {
switch (view.getId()) {
case C0019R.id.cloud_card_vip_enter:
a();
return;
case C0019R.id.checkable:
default:
return;
}
}
private void a() {
AspMobclickAgent.onEvent(this.aa, "cloud_card_vip_clicked");
Intent intent = new Intent(this, (Class<?>) BrowserActivity.class);
intent.putExtra("url", "http://txl.cytxl.com.cn/wap/plugs/members.php?token=" + ContactAccessor.getAuth(this.aa).l() + "&endpointId=" + ApplicationUtils.getUUID(this.aa) + "&version=" + ApplicationUtils.getVersionName(this.aa) + "&channel=" + ApplicationUtils.getChannel(this.aa));
intent.putExtra(MediaPlatformDBManager.KEY_TITLE, getResources().getString(C0019R.string.slidingmenu_item_vip));
startActivity(intent);
}
private void a(boolean z) {
this.H = z;
if (this.H) {
this.t.setScaleType(ImageView.ScaleType.CENTER_CROP);
} else {
this.t.setVisibility(8);
this.v.setBackgroundResource(C0019R.drawable.edit_contact_head_icon);
}
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.K = getContentResolver();
f();
requestWindowFeature(1);
setContentView(C0019R.layout.edit_cloud_contact_detail);
a((Context) this);
e();
this.G = getLayoutInflater();
this.J = getIcloudActionBar();
this.J.setNavigationMode(3);
this.u = (ImageView) findViewById(C0019R.id.call_show_bg);
this.w = (LinearLayout) findViewById(C0019R.id.list);
this.p = (TextView) findViewById(C0019R.id.contact_detail_name);
this.q = (TextView) findViewById(C0019R.id.contect_detail_company);
this.t = (ImageView) findViewById(C0019R.id.photoImage);
this.t.setOnClickListener(this);
this.v = (ViewGroup) findViewById(C0019R.id.photoImage_layout);
this.v.setOnClickListener(this);
this.r = (TextView) findViewById(C0019R.id.account_name);
this.s = (TextView) findViewById(C0019R.id.account_check);
this.s.setText("已关闭");
setHasOptionsMenu(false);
f1579a = 0;
Intent intent = getIntent();
String action = intent.getAction();
this.m = intent.getData();
Bundle extras = intent.getExtras();
this.e = extras.getString(AASConstants.ACCOUNT);
this.f = extras.getString("mobile");
if (this.f != null) {
this.r.setText(this.f);
} else {
this.r.setText(this.e);
}
if (this.m != null) {
if (action.equals("android.intent.action.EDIT")) {
if (bundle == null) {
a(getIntent().getExtras());
h();
new j(this, this).executeOnMainExecutor(new Void[0]);
}
f1579a = 1;
} else if (action.equals("android.intent.action.INSERT")) {
if (bundle == null) {
b(getIntent().getExtras());
h();
new j(this, this).executeOnMainExecutor(new Void[0]);
}
f1579a = 2;
}
}
if (f1579a == 0) {
finish();
} else {
c();
}
}
private void a(Context context) {
this.aa = context;
}
private Intent b() {
Intent intent = new Intent(this, (Class<?>) EditCloudContactActivity.class);
Bundle bundle = new Bundle();
bundle.putString(AASConstants.ACCOUNT, ApplicationUtils.getBundedPhoneNumber(this));
bundle.putString("mobile", this.f);
intent.putExtras(bundle);
return intent;
}
private void c() {
this.J.setVisibility(8, false);
View findViewById = findViewById(C0019R.id.titlebar);
com.aspire.yellowpage.utils.m.a(this.aa, findViewById);
com.chinamobile.contacts.im.utils.q.a(findViewById, C0019R.drawable.iab_green_back, "我的名片", new b(this));
com.chinamobile.contacts.im.utils.q.a(findViewById, C0019R.drawable.iab_green_edit_contact, new c(this));
}
public void a(AlumniCard alumniCard) {
Intent b2 = b();
b2.setAction("android.intent.action.EDIT");
Integer contactId = alumniCard.getContactId();
if (ContentUris.withAppendedId(com.chinamobile.contacts.im.provider.b.f3128a, contactId.intValue()) != null) {
b2.setData(ContentUris.withAppendedId(com.chinamobile.contacts.im.provider.b.f3128a, contactId.intValue()));
}
startActivity(b2);
}
public void d() {
Intent b2 = b();
b2.setAction("android.intent.action.INSERT");
b2.setData(com.chinamobile.contacts.im.provider.b.f3128a);
startActivity(b2);
}
private void e() {
this.x = (LinearLayout) findViewById(C0019R.id.contact_detail_phone_layout);
this.y = (LinearLayout) findViewById(C0019R.id.contact_detail_email_layout);
this.z = (LinearLayout) findViewById(C0019R.id.contact_detail_gender_layout);
this.A = (LinearLayout) findViewById(C0019R.id.contact_detail_address_layout);
this.C = (LinearLayout) findViewById(C0019R.id.contact_detail_fax_layout);
this.B = (LinearLayout) findViewById(C0019R.id.contact_detail_birthday_layout);
this.D = (LinearLayout) findViewById(C0019R.id.contact_detail_im_layout);
this.E = (LinearLayout) findViewById(C0019R.id.contact_detail_web_layout);
this.F = (LinearLayout) findViewById(C0019R.id.contact_detail_note_layout);
}
private void f() {
this.W.add(this.L);
this.W.add(this.M);
this.W.add(this.N);
this.W.add(this.O);
this.W.add(this.Q);
this.W.add(this.R);
this.W.add(this.S);
this.W.add(this.T);
this.W.add(this.U);
this.W.add(this.V);
}
@Override
public void onResume() {
super.onResume();
g();
this.l = false;
}
private void g() {
try {
if (f1579a == 2) {
if (as.b(this.aa, ApplicationUtils.getBundedPhoneNumber(this.aa)) != null) {
this.m = ContentUris.withAppendedId(com.chinamobile.contacts.im.provider.b.f3128a, r0.getContactId().intValue());
this.K.delete(this.m, null, null);
return;
}
return;
}
if (f1579a == 1) {
if (as.b(this.aa, ApplicationUtils.getBundedPhoneNumber(this.aa)) != null) {
this.m = ContentUris.withAppendedId(com.chinamobile.contacts.im.provider.b.f3128a, r0.getContactId().intValue());
}
a(getIntent().getExtras());
h();
new j(this, this).executeOnMainExecutor(new Void[0]);
}
} catch (Exception e) {
}
}
@Override
public void onPause() {
super.onPause();
this.l = true;
}
@Override
public void onDestroy() {
if (this.n != null && !this.n.isRecycled()) {
this.n.recycle();
}
super.onDestroy();
}
private void a(com.chinamobile.contacts.im.contacts.c.y yVar) {
if (Y == null) {
Y = new com.chinamobile.contacts.im.contacts.c.p();
}
if (yVar != null) {
Y.getStructuredName().c(yVar.f());
Y.setPhones(yVar.x());
}
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
if (i2 != -1) {
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
@Override
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
if (bundle != null) {
bundle.putString("filepath", this.k != null ? this.k.toString() : null);
}
}
@Override
protected void onRestoreInstanceState(Bundle bundle) {
super.onRestoreInstanceState(bundle);
if (this.k == null && bundle != null) {
String string = bundle.getString("filepath");
if (!TextUtils.isEmpty(string)) {
this.k = new File(string);
}
}
}
@Override
protected Dialog onCreateDialog(int i) {
switch (i) {
case 2:
return new AlertDialog.Builder(this).setTitle("删除").setIcon(R.drawable.ic_dialog_alert).setMessage("将会删除此联系人。").setNegativeButton(R.string.cancel, (DialogInterface.OnClickListener) null).setPositiveButton(R.string.ok, this.ab).setCancelable(false).create();
default:
return super.onCreateDialog(i);
}
}
private static String[] a(Context context, int i) {
Resources resources = context.getResources();
switch (i) {
case 1:
return resources.getStringArray(R.array.emailAddressTypes);
case 2:
return resources.getStringArray(R.array.postalAddressTypes);
case 3:
return resources.getStringArray(R.array.imProtocols);
case 4:
return resources.getStringArray(R.array.organizationTypes);
case 5:
return resources.getStringArray(R.array.phoneTypes);
case 6:
default:
return resources.getStringArray(C0019R.array.otherLabels);
case 7:
return resources.getStringArray(C0019R.array.webTypes);
}
}
public void a(Bundle bundle) {
Object a2;
h e;
Cursor query = this.K.query(this.m, null, null, null, null);
if (query == null || !query.moveToFirst()) {
ApplicationUtils.closeCursor(query);
finish();
return;
}
int columnIndex = query.getColumnIndex("display_name");
int columnIndex2 = query.getColumnIndex("account_id");
int columnIndex3 = query.getColumnIndex("photo");
int columnIndex4 = query.getColumnIndex("photo_id");
int columnIndex5 = query.getColumnIndex("ringtone");
int columnIndex6 = query.getColumnIndex("send_to_voicemail");
int columnIndex7 = query.getColumnIndex("sync_flag");
int columnIndex8 = query.getColumnIndex("style");
int columnIndex9 = query.getColumnIndex("birthday");
int columnIndex10 = query.getColumnIndex("gender");
String string = query.getString(columnIndex);
this.c = query.getString(columnIndex2);
this.d = query.getString(columnIndex4);
this.h = query.getInt(columnIndex7);
this.g = com.chinamobile.contacts.im.contacts.d.k.a(query.getInt(columnIndex8));
String string2 = query.getString(columnIndex9);
String string3 = query.getString(columnIndex10);
this.u.setImageResource(com.chinamobile.contacts.im.utils.n.a(this.g));
if (this.h == 1) {
this.s.setText("已开启");
} else {
this.s.setText("已关闭");
}
query.getString(columnIndex5);
query.getString(columnIndex6);
this.Z.d(string);
this.p.setText(string);
this.p.addTextChangedListener(this);
this.n = a(this.K, query, columnIndex3, null);
if (this.n == null) {
a(false);
} else {
a(true);
this.t.setVisibility(0);
this.t.setImageBitmap(ApplicationUtils.getCroppedCloudBitmap(this.n));
this.v.setBackgroundResource(C0019R.drawable.icon_border2);
}
ApplicationUtils.closeCursor(query);
int size = this.W.size();
for (int i = 0; i < size; i++) {
this.W.get(i).clear();
}
if (string3 != null) {
this.O.add(h.c(this, string3, this.m));
this.af = true;
}
if (string2 != null) {
this.V.add(h.b(this, string2, this.m));
this.ae = true;
}
Cursor query2 = this.K.query(com.chinamobile.contacts.im.provider.c.f3129a, null, "contact_id=" + ContentUris.parseId(this.m), null, null);
if (query2 != null && query2.moveToFirst()) {
int columnIndex11 = query2.getColumnIndex("_id");
int columnIndex12 = query2.getColumnIndex(Telephony.Mms.Addr.CONTACT_ID);
int columnIndex13 = query2.getColumnIndex("mimetype");
int columnIndex14 = query2.getColumnIndex("data1");
int columnIndex15 = query2.getColumnIndex("data2");
int columnIndex16 = query2.getColumnIndex("data3");
int columnIndex17 = query2.getColumnIndex("data4");
query2.getColumnIndex("data15");
int columnIndex18 = query2.getColumnIndex("is_primary");
do {
int i2 = query2.getInt(columnIndex13);
int i3 = query2.getInt(columnIndex15);
String string4 = query2.getString(columnIndex14);
String string5 = query2.getString(columnIndex16);
String string6 = query2.getString(columnIndex17);
query2.getInt(columnIndex12);
boolean z = query2.getLong(columnIndex18) != 0;
int i4 = query2.getInt(columnIndex11);
Uri withAppendedId = ContentUris.withAppendedId(com.chinamobile.contacts.im.provider.c.f3129a, i4);
if (i2 == 4) {
h a3 = h.a(this, null, i3, string4, string5, string6, withAppendedId, i4);
a3.k = z;
this.S.add(a3);
} else if (i2 == 104) {
this.O.add(h.c(this, string4, withAppendedId));
} else if (i2 == 6) {
if (!this.ac) {
this.U.add(h.a(this, string4, withAppendedId, i4));
this.ac = true;
}
} else if (i2 == 7) {
this.T.add(h.b(this, string4, withAppendedId, i4));
} else if (i2 == 5) {
if (i3 == 4) {
h b2 = h.b(this, null, i3, string4, withAppendedId, i4);
b2.k = z;
this.M.add(b2);
} else {
this.ad = true;
h a4 = h.a(this, null, i3, string4, withAppendedId, i4);
a4.k = z;
this.L.add(a4);
}
} else if (i2 == 1) {
h c = h.c(this, null, i3, string4, withAppendedId, i4);
c.k = z;
this.N.add(c);
if (i3 == 1) {
}
} else if (i2 == 2) {
h d = h.d(this, null, i3, string4, withAppendedId, i4);
d.k = z;
this.R.add(d);
} else if (i2 == 3 && (a2 = a(string4)) != null) {
if (a2 instanceof Number) {
int intValue = ((Number) a2).intValue();
e = h.e(this, a(this, 3)[intValue], intValue, string4, withAppendedId, i4);
} else {
e = h.e(this, a2.toString(), i3, string4, withAppendedId, i4);
}
this.Q.add(e);
}
} while (query2.moveToNext());
}
ApplicationUtils.closeCursor(query2);
if (!this.ad) {
this.L.add(h.a(this, (Uri) null, 2));
}
if (!this.ac) {
this.U.add(h.a(this, (String) null, (Uri) null));
this.ac = true;
}
this.I = false;
}
private void b(Bundle bundle) {
int size = this.W.size();
for (int i = 0; i < size; i++) {
this.W.get(i).clear();
}
this.h = 1;
if (this.h == 1) {
this.s.setText("已开启");
} else {
this.s.setText("已关闭");
}
this.g = 0;
this.u.setImageResource(com.chinamobile.contacts.im.utils.n.a(this.g));
if (!this.ad) {
h a2 = h.a(this, (Uri) null, 2);
a2.k = true;
this.L.add(a2);
}
if (!this.ac) {
this.U.add(h.a(this, (String) null, (Uri) null));
}
}
public void h() {
e();
a(this.S);
a(this.x, this.L, 3);
b(this.y, this.N, 4);
b(this.z, this.O, 101);
b(this.C, this.M, 10);
b(this.D, this.Q, 5);
b(this.E, this.T, 9);
b(this.F, this.U, 8);
a(this.Z);
}
private void a(ArrayList<h> arrayList) {
String str = "";
Iterator<h> it = arrayList.iterator();
while (it.hasNext()) {
h next = it.next();
if (!TextUtils.isEmpty(next.r)) {
str = str + next.r + " ";
}
if (!TextUtils.isEmpty(next.f)) {
str = str + next.f + " ";
}
if (!TextUtils.isEmpty(next.g)) {
str = str + next.g + " ";
}
}
if (!TextUtils.isEmpty(str)) {
this.q.setText(str);
this.q.setVisibility(0);
} else {
this.q.setVisibility(8);
}
this.q.setText(str);
}
private void a(LinearLayout linearLayout, ArrayList<h> arrayList, int i) {
String str;
try {
linearLayout.removeAllViews();
linearLayout.setVisibility(0);
findViewById(C0019R.id.conatct_detail_phone_tag).setVisibility(8);
ArrayList arrayList2 = new ArrayList();
Iterator<h> it = arrayList.iterator();
while (it.hasNext()) {
h next = it.next();
View inflate = LayoutInflater.from(this).inflate(C0019R.layout.cloud_contact_detail_phone_item, (ViewGroup) null);
LinearLayout linearLayout2 = (LinearLayout) inflate.findViewById(C0019R.id.contact_detail_message_layout);
LinearLayout linearLayout3 = (LinearLayout) inflate.findViewById(C0019R.id.contact_detail_phone_layout);
TextView textView = (TextView) inflate.findViewById(C0019R.id.contact_detail_phone_number);
((TextView) inflate.findViewById(C0019R.id.contact_detail_phone_type_name)).setText(next.q);
textView.setText(next.r);
com.chinamobile.icloud.im.sync.a.p pVar = new com.chinamobile.icloud.im.sync.a.p();
pVar.a(next.r);
pVar.b(1);
arrayList2.add(pVar);
if (next.r != null) {
str = Jni.findLoc(next.r).replace(IAoiMessage.R, "") + " " + com.chinamobile.contacts.im.utils.z.a(next.r.replace(IAoiMessage.R, ""));
} else {
str = null;
}
TextView textView2 = (TextView) inflate.findViewById(C0019R.id.contect_detail_phone_location);
if (str != null) {
str = str.trim();
}
if (!TextUtils.isEmpty(str)) {
textView2.setVisibility(0);
textView2.setText(str);
} else {
textView2.setVisibility(8);
}
String charSequence = textView.getText().toString();
e eVar = new e(this);
f fVar = new f(this, charSequence);
linearLayout3.setOnClickListener(eVar);
linearLayout2.setOnClickListener(fVar);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, ApplicationUtils.dip2px(this, 55.0f));
if (!TextUtils.isEmpty(charSequence)) {
this.x.addView(inflate, layoutParams);
a(this.x);
}
}
this.Z.b(arrayList2);
} catch (Exception e) {
e.printStackTrace();
}
}
private void b(LinearLayout linearLayout, ArrayList<h> arrayList, int i) {
linearLayout.removeAllViews();
linearLayout.setVisibility(0);
View findViewById = findViewById(C0019R.id.conatct_detail_email_tag);
linearLayout.addView(this.G.inflate(C0019R.layout.edit_cloud_divider, (ViewGroup) linearLayout, false));
Iterator<h> it = arrayList.iterator();
while (it.hasNext()) {
h next = it.next();
next.f1623a = this;
if (!next.l && !TextUtils.isEmpty(next.r)) {
View inflate = LayoutInflater.from(this).inflate(C0019R.layout.cloud_contact_detail_common_item, (ViewGroup) null);
TextView textView = (TextView) inflate.findViewById(C0019R.id.contact_detail_common_info);
if (i == 101) {
if (next.r.equals("0") || next.r.equals("男")) {
textView.setText("男");
} else if (next.r.equals("1") || next.r.equals("女")) {
textView.setText("女");
} else if (next.r.equals("2") || next.r.equals("保密")) {
textView.setText("保密");
} else {
linearLayout.setVisibility(8);
}
} else {
textView.setText(next.r);
}
if (i == 8) {
textView.setOnClickListener(new g(this, textView.getText().toString()));
}
((TextView) inflate.findViewById(C0019R.id.contact_detail_common_type_name)).setText(next.q);
linearLayout.addView(inflate, new LinearLayout.LayoutParams(-1, -2));
findViewById.setVisibility(0);
a(linearLayout);
}
}
}
public void b(String str) {
ArrayList arrayList = new ArrayList();
if (!TextUtils.isEmpty(str)) {
com.chinamobile.contacts.im.utils.al alVar = new com.chinamobile.contacts.im.utils.al();
alVar.a("");
alVar.b(str);
arrayList.add(alVar);
}
if (arrayList.size() > 0) {
new ListDialog(this.aa, new com.chinamobile.contacts.im.utils.ai(this.aa, arrayList), null, "备注").show();
}
}
private void a(LinearLayout linearLayout) {
ImageView imageView = new ImageView(this);
imageView.setBackgroundResource(C0019R.drawable.list_line);
linearLayout.addView(imageView, new LinearLayout.LayoutParams(-1, -2));
}
@Override
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (i != 4) {
return super.onKeyDown(i, keyEvent);
}
finish();
return false;
}
@Override
public void afterTextChanged(Editable editable) {
this.I = true;
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onFocusChange(View view, boolean z) {
view.setSelected(z);
}
public static Object a(String str) {
if (str == null) {
return null;
}
if (str.startsWith("pre:")) {
return Integer.valueOf(Integer.parseInt(str.substring(4)));
}
if (str.startsWith("custom:")) {
return str.substring(7);
}
return str;
}
public static Bitmap a(ContentResolver contentResolver, Cursor cursor, int i, BitmapFactory.Options options) {
try {
InputStream a2 = a(contentResolver, cursor, i);
if (a2 != null) {
return BitmapFactory.decodeStream(a2, null, options);
}
return null;
} catch (OutOfMemoryError e) {
Bitmap bitmap = null;
while (bitmap == null) {
System.gc();
System.runFinalization();
InputStream a3 = a(contentResolver, cursor, i);
bitmap = a3 != null ? BitmapFactory.decodeStream(a3, null, options) : null;
}
return bitmap;
}
}
public static InputStream a(ContentResolver contentResolver, Cursor cursor, int i) {
byte[] blob;
try {
blob = cursor.getBlob(i);
} catch (Exception e) {
if (cursor == null) {
return null;
}
} catch (Throwable th) {
if (cursor != null) {
cursor.close();
}
throw th;
}
if (blob == null) {
if (cursor == null) {
return null;
}
cursor.close();
return null;
}
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(blob);
if (cursor != null) {
cursor.close();
}
return byteArrayInputStream;
}
}