导航菜单

页面标题

页面副标题

050 IP Phone v2.3.0 - CommonCallLogDeleteActivity.java 源代码

正在查看: 050 IP Phone v2.3.0 应用的 CommonCallLogDeleteActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.ntt.voip.android.client;

import android.content.Context;
import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.provider.CallLog;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.ntt.voip.android.client.a;
import com.oki_access.android.ims.call.client.CallLogDeleteActivity;
import com.oki_access.android.ims.call.client.b;
import com.oki_access.android.ims.call.d;
import com.oki_access.android.ims.call.provider.a;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import t4.z;
import z2.c;

public class CommonCallLogDeleteActivity extends CallLogDeleteActivity {
    protected boolean s0;
    protected final Map<Long, Boolean> Z = new HashMap();
    private Object t0 = new Object();
    private boolean u0 = false;

    protected class a extends CallLogDeleteActivity.b {
        protected a() {
            super();
        }

        @Override
        public void a(View view, b.C0039b c0039b) {
            TextView textView = (TextView) view.findViewById(d.d.e());
            TextView textView2 = (TextView) view.findViewById(d.d.h());
            TextView textView3 = (TextView) view.findViewById(d.d.l());
            TextView textView4 = (TextView) view.findViewById(d.d.k());
            ImageView imageView = (ImageView) view.findViewById(d.d.f());
            ImageView imageView2 = (ImageView) view.findViewById(d.d.i());
            CheckBox checkBox = (CheckBox) view.findViewById(d.d.c());
            imageView.setImageResource(c0039b.c);
            textView.setTextColor(c0039b.e);
            textView2.setTextColor(c0039b.e);
            textView3.setTextColor(c0039b.e);
            textView.setText(c0039b.f);
            textView2.setText(c0039b.g);
            textView2.setVisibility(c0039b.h);
            imageView2.setImageBitmap(c0039b.j);
            c0039b.q = imageView2;
            textView3.setText(c0039b.k);
            textView4.setText(c0039b.n);
            textView4.setVisibility(c0039b.o);
            boolean isChecked = ((CheckBox) CommonCallLogDeleteActivity.this.findViewById(d.d.d())).isChecked();
            if (((a.C0017a) c0039b).v) {
                Boolean bool = CommonCallLogDeleteActivity.this.Z.get(Long.valueOf(c0039b.a));
                if (bool == null) {
                    CommonCallLogDeleteActivity.this.Z.put(Long.valueOf(c0039b.a), Boolean.valueOf(isChecked));
                } else {
                    isChecked = bool.booleanValue();
                }
            } else {
                Boolean bool2 = (Boolean) ((CallLogDeleteActivity) CommonCallLogDeleteActivity.this).X.get(Long.valueOf(c0039b.a));
                if (bool2 == null) {
                    ((CallLogDeleteActivity) CommonCallLogDeleteActivity.this).X.put(Long.valueOf(c0039b.a), Boolean.valueOf(isChecked));
                } else {
                    isChecked = bool2.booleanValue();
                }
            }
            checkBox.setChecked(isChecked);
            view.setTag(c0039b);
        }
    }

    @Override
    protected com.oki_access.android.ims.call.client.b U(Context context, int i, int i8) {
        return new com.ntt.voip.android.client.a(context, i, i8);
    }

    @Override
    protected void c0() {
        super.c0();
        ((com.ntt.voip.android.client.a) this.y).h0(getIntent().getIntExtra("extra_call_log_filter", 3));
    }

    @Override
    protected int e0(Iterator<Map.Entry<Long, Boolean>> it) {
        int i;
        int i8;
        StringBuilder sb = new StringBuilder();
        ArrayList arrayList = new ArrayList();
        Iterator<Map.Entry<Long, Boolean>> it2 = this.X.entrySet().iterator();
        boolean z = true;
        while (true) {
            i = 0;
            if (!it2.hasNext()) {
                break;
            }
            Map.Entry<Long, Boolean> next = it2.next();
            if (next.getValue().booleanValue()) {
                if (z) {
                    z = false;
                } else {
                    sb.append(" OR ");
                }
                sb.append("_id=?");
                arrayList.add(String.valueOf(next.getKey()));
            }
        }
        if (arrayList.size() > 0) {
            String[] strArr = new String[arrayList.size()];
            Iterator it3 = arrayList.iterator();
            int i9 = 0;
            while (it3.hasNext()) {
                strArr[i9] = (String) it3.next();
                i9++;
            }
            i8 = getContentResolver().delete(a.C0042a.x, sb.toString(), strArr);
            if (Build.VERSION.SDK_INT >= 30) {
                this.y.o().dispatchChange(true, null);
            }
            z.n("CommonCallLogDeleteActivity", "onDeleteItems app log : " + i8);
        } else {
            i8 = 0;
        }
        arrayList.clear();
        StringBuilder sb2 = new StringBuilder();
        boolean z7 = true;
        for (Map.Entry<Long, Boolean> entry : this.Z.entrySet()) {
            if (entry.getValue().booleanValue()) {
                if (z7) {
                    z7 = false;
                } else {
                    sb2.append(" OR ");
                }
                sb2.append("_id=?");
                arrayList.add(String.valueOf(entry.getKey()));
            }
        }
        if (arrayList.size() > 0) {
            String[] strArr2 = new String[arrayList.size()];
            Iterator it4 = arrayList.iterator();
            while (it4.hasNext()) {
                strArr2[i] = (String) it4.next();
                i++;
            }
            i = getContentResolver().delete(CallLog.Calls.CONTENT_URI, sb2.toString(), strArr2);
            if (Build.VERSION.SDK_INT >= 30) {
                this.y.o().dispatchChange(true, null);
            }
            z.n("CommonCallLogDeleteActivity", "onDeleteItems device log : " + i);
        }
        return i8 + i;
    }

    @Override
    protected void g0() {
        this.X.clear();
        this.Z.clear();
        Cursor a0 = ((com.ntt.voip.android.client.a) this.y).a0();
        int i = 0;
        if (a0 != null) {
            if (a0.moveToFirst()) {
                do {
                    boolean e0 = com.ntt.voip.android.client.a.e0(a0);
                    long j = a0.getLong(a0.getColumnIndex("_id"));
                    if (e0) {
                        this.Z.put(Long.valueOf(j), Boolean.FALSE);
                    } else {
                        this.X.put(Long.valueOf(j), Boolean.FALSE);
                    }
                    i++;
                } while (a0.moveToNext());
            }
            a0.close();
        }
        z.n("CommonCallLogDeleteActivity", "resetCheckMap cnt: " + i);
    }

    @Override
    protected void j0() {
        Iterator<Boolean> it = this.X.values().iterator();
        boolean z = false;
        while (it.hasNext()) {
            z |= it.next().booleanValue();
        }
        Iterator<Boolean> it2 = this.Z.values().iterator();
        while (it2.hasNext()) {
            z |= it2.next().booleanValue();
        }
        findViewById(d.d.b()).setEnabled(z);
    }

    protected void m0(boolean z) {
        String[] strArr = c.b0;
        boolean z7 = false;
        if (ContextCompat.checkSelfPermission(this, strArr[0]) == 0 && ContextCompat.checkSelfPermission(this, strArr[1]) == 0) {
            z7 = true;
        }
        this.s0 = z7;
        if (!z7 && z) {
            synchronized (this.t0) {
                try {
                    z.a("CommonCallLogDeleteActivity", "checkAllPermissionGranted: mDoing=[" + this.u0 + "]");
                    if (!this.u0) {
                        ActivityCompat.requestPermissions(this, strArr, 2001);
                        this.u0 = true;
                    }
                } finally {
                }
            }
        }
        z.n("CommonCallLogDeleteActivity", "checkAllPermissionGranted doRequest: " + z + " call-log: " + this.s0);
    }

    @Override
    public a V() {
        return new a();
    }

    @Override
    public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
        Iterator<Long> it = this.Z.keySet().iterator();
        int i = 0;
        while (it.hasNext()) {
            this.Z.put(it.next(), Boolean.valueOf(z));
            i++;
        }
        z.n("CommonCallLogDeleteActivity", "onCheckedChanged cnt: " + i);
        super.onCheckedChanged(compoundButton, z);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        this.s0 = getIntent().getBooleanExtra("extra_call_log_permission", false);
        z.a("CommonCallLogDeleteActivity", "onCreate: isCallLogPermissionGranted=[" + this.s0 + "]");
        m0(true);
        super.onCreate(bundle);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        this.Z.clear();
    }

    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        z.a("CommonCallLogDeleteActivity", "onRequestPermissionsResult: requestCode=[" + i + "], permissions.length=[" + strArr.length + "], grantResult.length=[" + iArr.length + "]");
        if (i != 2001) {
            synchronized (this.t0) {
                this.u0 = false;
            }
            return;
        }
        try {
            boolean z = true;
            if (iArr.length > 0) {
                for (int i8 = 0; i8 < iArr.length; i8++) {
                    if (iArr[i8] == -1) {
                        if (ActivityCompat.shouldShowRequestPermissionRationale(this, strArr[i8])) {
                            z.a("CommonCallLogDeleteActivity", "onRequestPermissionsResult: " + strArr[i8] + " is denied.");
                        } else {
                            z.a("CommonCallLogDeleteActivity", "onRequestPermissionsResult: " + strArr[i8] + " is PERMANENTLY denied.");
                        }
                        z = false;
                    } else {
                        z.a("CommonCallLogDeleteActivity", "onRequestPermissionsResult: " + strArr[i8] + " is granted.");
                    }
                }
            }
            this.s0 = z;
            if (z) {
                f0();
            }
            synchronized (this.t0) {
                this.u0 = false;
            }
        } catch (Throwable th) {
            synchronized (this.t0) {
                this.u0 = false;
                throw th;
            }
        }
    }

    @Override
    protected void onRestoreInstanceState(@NonNull Bundle bundle) {
        super.onRestoreInstanceState(bundle);
        h0(bundle, "save_state_key_check_map_device_values", this.Z);
        j0();
    }

    @Override
    protected void onResume() {
        m0(false);
        super.onResume();
    }

    @Override
    protected void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        i0(bundle, "save_state_key_check_map_device_values", this.Z);
    }

    @Override
    public void v(ListView listView, View view, int i, long j) {
        CheckBox checkBox = (CheckBox) view.findViewById(Y());
        checkBox.toggle();
        a.C0017a c0017a = (a.C0017a) view.getTag();
        if (c0017a.v) {
            this.Z.put(Long.valueOf(c0017a.a), Boolean.valueOf(checkBox.isChecked()));
        } else {
            this.X.put(Long.valueOf(c0017a.a), Boolean.valueOf(checkBox.isChecked()));
        }
        j0();
    }
}