Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 705d0751 authored by Koushik Dutta's avatar Koushik Dutta Committed by Chirayu Desai
Browse files

Use a hashed ANDROID_ID instead of IMEI for stats collection.

Change-Id: I7379c5b380273e35b5aab582f5268d6946e0a255
parent 4b006943
Loading
Loading
Loading
Loading
+2 −16
Original line number Diff line number Diff line
@@ -22,26 +22,12 @@ import java.security.MessageDigest;

import android.content.Context;
import android.os.SystemProperties;
import android.provider.Settings;
import android.telephony.TelephonyManager;

public class Utilities {
    public static String getUniqueID(Context ctx) {
        TelephonyManager tm = (TelephonyManager) ctx
                .getSystemService(Context.TELEPHONY_SERVICE);

        String device_id = digest(tm.getDeviceId());
        if (device_id == null) {
            String wifiInterface = SystemProperties.get("wifi.interface");
            try {
                String wifiMac = new String(NetworkInterface.getByName(
                        wifiInterface).getHardwareAddress());
                device_id = digest(wifiMac);
            } catch (Exception e) {
                device_id = null;
            }
        }

        return device_id;
        return digest(ctx.getPackageName() + Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID));
    }

    public static String getCarrier(Context ctx) {