com.samsung.android.contacts | What is samsung android contacts

If you are searching for com.samsung.android.contacts then you are at right place. Here we are going to discuss in deep about all the things need for samsung android contacts. When we are collecting some data to write this blog, we found two different community who have some questions on it. The first one is the IBM community, on which some samsung galaxy tabs are in kiosk mode with all internal applications and the person want to add some more tabs with the same kiosk mode. The second community is of Samsung, where gossipfunda found the very basic question of activity of google account with activity of com.samsung.android.contacts, what does all mean? So, let’s dive into deep.

What is com.samsung.android.contacts

To understand the basic term break the tterm as “com samsung android contacts.” So, it is nothing but the package for contacts in Samsung android device. This package is always benign imported when we make an call to the contacts from any mode. To make very clear, this package has imported in different class, in which three important classes are:

  1. PreferenceMigrationService
  2. C0069a
  3. ContactsMigratorApplication

PreferenceMigrationService

The Preference Migration Service have the following code with package com.samsung.android.contacts.migration

package com.samsung.android.contacts.migration;

import android.app.IntentService;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Messenger;
import android.preference.PreferenceManager;
import android.util.Pair;
import androidx.core.p005a.C0023b;
import com.samsung.android.dialtacts.p008a.C0070a;
import com.samsung.android.dialtacts.p008a.C0071b;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class PreferenceMigrationService extends IntentService {
    /* access modifiers changed from: private */

    /* renamed from: a */
    public Context f170a;
    /* access modifiers changed from: private */

    /* renamed from: b */
    public Messenger f171b;
    /* access modifiers changed from: private */

    /* renamed from: c */
    public Thread f172c = null;
    /* access modifiers changed from: private */

    /* renamed from: d */
    public final List f173d = new ArrayList();

    public PreferenceMigrationService() {
        super("PreferenceMigrationService");
    }

            throw new UnsupportedOperationException("Method not decompiled: com.samsung.android.contacts.migration.PreferenceMigrationService.m298a(java.io.File):java.io.File");
    }

    /* renamed from: a */
    private List m300a(List list) {
        if (list == null) {
            C0070a.m310d("PreferenceMigrationService", "getFileList() = null");
            return null;
        }
        ArrayList arrayList = new ArrayList();
        Iterator it = list.iterator();
        while (it.hasNext()) {
            Pair pair = (Pair) it.next();
            C0070a.m309c("PreferenceMigrationService", "getFileList p " + pair.first + " : " + ((String) pair.second));
            File file = new File((File) pair.first, "");
            if (file.exists()) {
                int i = 0;
                if (((String) pair.second).length() > 0) {
                    File[] listFiles = file.listFiles();
                    int length = listFiles.length;
                    while (i < length) {
                        File file2 = listFiles[i];
                        if (file2.getPath().contains((CharSequence) pair.second)) {
                            String path = ((File) pair.first).getPath();
                            int lastIndexOf = path.lastIndexOf(47);
                            arrayList.add(lastIndexOf != -1 ? Pair.create(file2, path.substring(lastIndexOf + 1)) : Pair.create(file2, ""));
                        }
                        i++;
                    }
                } else {
                    File[] listFiles2 = file.listFiles();
                    int length2 = listFiles2.length;
                    while (i < length2) {
                        File file3 = listFiles2[i];
                        String path2 = ((File) pair.first).getPath();
                        int lastIndexOf2 = path2.lastIndexOf(47);
                        arrayList.add(lastIndexOf2 != -1 ? Pair.create(file3, path2.substring(lastIndexOf2 + 1)) : Pair.create(file3, ""));
                        i++;
                    }
                }
            }
        }
        return arrayList;
    }

    /* renamed from: a */
    private void m301a() {
        if (this.f171b == null) {
            this.f171b = new Messenger(new C0069a(this, this.f170a.getMainLooper()));
        }
    }

    /* renamed from: a */
    private void m302a(String str, Pair pair) {
        ComponentName componentName;
        File a = m298a((File) pair.first);
        String str2 = (String) pair.second;
        C0070a.m310d("PreferenceMigrationService", "request migration for preference : " + a.getName() + " subDirectory = " + str2);
        Intent intent = new Intent("com.samsung.android.contacts.ACTION_MIGRATE_RESPONSE");
        String str3 = "shared_prefs";
        if (str3.equals(str2)) {
            intent.putExtra("isDefaultPreference", a.getName().contains(PreferenceManager.getDefaultSharedPreferencesName(this.f170a)));
        } else {
            str3 = "databases";
            if (!str3.equals(str2)) {
                C0070a.m308b("PreferenceMigrationService", "migrateToCaller() Error  file.getPath()  " + a.getPath());
                return;
            }
        }
        intent.putExtra("filePathType", str3);
        Uri b = m305b(a);
        this.f170a.grantUriPermission(str, b, 1);
        intent.setData(b);
        intent.putExtra("fileName", a.getName());
        intent.setFlags(1);
        if (str.contentEquals("com.samsung.android.dialer")) {
            componentName = new ComponentName("com.samsung.android.dialer", "com.samsung.android.dialer.migration.DialerMigrationService");
        } else {
            if (str.contentEquals("com.samsung.android.app.contacts")) {
                componentName = new ComponentName("com.samsung.android.app.contacts", "com.samsung.android.contacts.migration.ContactsMigrationService");
            }
            intent.putExtra("resultReceiveMessenger", this.f171b);
            C0070a.m309c("PreferenceMigrationService", "messenger : " + this.f171b + " : " + intent.getComponent());
            this.f173d.add(b);
            this.f170a.startService(intent);
        }
        intent.setComponent(componentName);
        intent.putExtra("resultReceiveMessenger", this.f171b);
        C0070a.m309c("PreferenceMigrationService", "messenger : " + this.f171b + " : " + intent.getComponent());
        this.f173d.add(b);
        this.f170a.startService(intent);
    }

    /* renamed from: a */
    private boolean m303a(String str) {
        ComponentName componentName;
        ArrayList arrayList = new ArrayList();
        arrayList.add(Pair.create(new File(this.f170a.getDataDir(), "shared_prefs"), ""));
        arrayList.add(Pair.create(new File(this.f170a.getDataDir(), "databases"), "recent_search"));
        if (str.contentEquals("com.samsung.android.app.contacts")) {
            arrayList.add(Pair.create(new File(this.f170a.getDataDir(), "databases"), "agif_history"));
        }
        List<Pair> a = m300a((List) arrayList);
        if (a == null) {
            return false;
        }
        int size = a.size();
        C0070a.m310d("PreferenceMigrationService", "doMigration() file size = " + size);
        for (Pair a2 : a) {
            m302a(str, a2);
        }
        Intent intent = new Intent("com.samsung.android.contacts.ACTION_MIGRATE_COMPLETE");
        if (str.contentEquals("com.samsung.android.dialer")) {
            componentName = new ComponentName("com.samsung.android.dialer", "com.samsung.android.dialer.migration.DialerMigrationService");
        } else {
            if (str.contentEquals("com.samsung.android.app.contacts")) {
                componentName = new ComponentName("com.samsung.android.app.contacts", "com.samsung.android.contacts.migration.ContactsMigrationService");
            }
            intent.putExtra("resultReceiveMessenger", this.f171b);
            C0070a.m309c("PreferenceMigrationService", "messenger : " + this.f171b + " : " + intent.getComponent());
            this.f170a.startService(intent);
            return true;
        }
        intent.setComponent(componentName);
        intent.putExtra("resultReceiveMessenger", this.f171b);
        C0070a.m309c("PreferenceMigrationService", "messenger : " + this.f171b + " : " + intent.getComponent());
        this.f170a.startService(intent);
        return true;
    }

    /* renamed from: b */
    private Uri m305b(File file) {
        Context context = this.f170a;
        return C0023b.m54a(context, this.f170a.getPackageName() + ".contact_files", file);
    }

    public void onDestroy() {
        super.onDestroy();
        C0070a.m310d("PreferenceMigrationService", "onDestroy()");
    }

    /* access modifiers changed from: protected */
    public void onHandleIntent(Intent intent) {
        if (intent != null && intent.getAction() != null) {
            this.f170a = C0071b.m311a();
            if (!"com.samsung.android.contacts.ACTION_MIGRATE_PREFERENCE".equals(intent.getAction()) || intent.getStringExtra("applicationId") == null) {
                C0070a.m307a("PreferenceMigrationService", "invalid request : action(" + intent.getAction() + "), applicationId(" + intent.getStringExtra("applicationId") + ")");
                return;
            }
            m301a();
            if (m303a(intent.getStringExtra("applicationId"))) {
                C0070a.m310d("PreferenceMigrationService", "onHandleIntent() waiting");
                this.f172c = Thread.currentThread();
                try {
                    Thread.sleep(30000);
                } catch (InterruptedException unused) {
                    C0070a.m310d("PreferenceMigrationService", "Interrupt() called");
                }
                this.f172c = null;
                C0070a.m310d("PreferenceMigrationService", "onHandleIntent() end");
            }
        }
    }
}

C0069a

The class C0069a has the code:

package com.samsung.android.contacts.migration;

import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
import com.samsung.android.dialtacts.p008a.C0070a;

/* renamed from: com.samsung.android.contacts.migration.a */
class C0069a extends Handler {

    /* renamed from: a */
    final /* synthetic */ PreferenceMigrationService f174a;

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    C0069a(PreferenceMigrationService preferenceMigrationService, Looper looper) {
        super(looper);
        this.f174a = preferenceMigrationService;
    }

    public void handleMessage(Message message) {
        super.handleMessage(message);
        if (message.getData() == null) {
            C0070a.m307a("PreferenceMigrationService", "bundle is null, this causes dirty cache");
            return;
        }
        if (this.f174a.f173d.size() != 0) {
            for (Uri uri : this.f174a.f173d) {
                this.f174a.f170a.revokeUriPermission(uri, 1);
                this.f174a.f170a.getContentResolver().delete(uri, (String) null, (String[]) null);
            }
            this.f174a.f173d.clear();
        }
        Messenger unused = this.f174a.f171b = null;
        C0070a.m310d("PreferenceMigrationService", "migration complete");
        if (this.f174a.f172c != null && this.f174a.f172c.isAlive()) {
            this.f174a.f172c.interrupt();
        }
    }
}

ContactsMigratorApplication

The class Contacts Migrator Application is calling the super class C0071b.m312a(this).

package com.samsung.android.contacts;

import android.app.Application;
import com.samsung.android.dialtacts.p008a.C0071b;

public class ContactsMigratorApplication extends Application {
    public void onCreate() {
        super.onCreate();
        C0071b.m312a(this);
    }
}

Fix kiosk mode for Samsung Device

As per the code shown above you need to whitelist the following bundle package IDs:

See also  Wyze Cam 1080p HD Indoor Wireless Smart home camera

Activity of google account with com.samsung.android.contacts

When you install google contacts in collaboration with Samsung contacts, then you are processing in charge of managing and / or viewing Google Contacts on the Samsung device.

How to fix com.samsung.android.contacts has stopped

To fix contacts has stopped you need to follow the steps:

Method1: Clear Cache & Clear Data

Open setting then Apps, click on three dots on upper right hand side.

three dots on upper right hand side
three dots on upper right hand side

Next check on Show System Apps

show-system-apps
show-system-apps

Search for Contacts

com.samsung.android.contacts
com.samsung.android.contacts

Click on each and every contacts one by one, and go to storage, then tap on clear cache and clear data for all the contacts

clear cache and clear data for all the contacts

This will fix the problem.

Method2: Force Stop

Go to Setting-> Apps-> Show system App-> Open Contacts->Force Stop

com.samsung.android.contacts Force Stop

Method3: Uninstall and reinstall

Go to Setting-> Apps-> Show system App-> Open Contacts->Uninstall

Uninstall

Go to Samsung Store-> Search for Contacts and install it. This will fix your problem.

Conclusion

In conclusion, we have discussed all the aspects of com.samsung.android.contacts, whether its is kiosk mode, google activity, or how to fix contacts has stopped. Hope you find this post resourceful. Post your comment what you know about it to help others.