feat: 联系人增加头像选择
This commit is contained in:
@@ -4,16 +4,24 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.ttstd.dialer.config.CommonConfig;
|
||||
import com.ttstd.dialer.manager.AppManager;
|
||||
import com.ttstd.dialer.utils.Logger;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class AppChangedReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "ApkInstallReceiver";
|
||||
private static final String TAG = "AppChangedReceiver";
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
// 创建一个单线程池用于处理应用变更事件
|
||||
private static final ExecutorService sExecutor = Executors.newSingleThreadExecutor();
|
||||
|
||||
@Override
|
||||
public void onReceive(final Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
@@ -35,6 +43,13 @@ public class AppChangedReceiver extends BroadcastReceiver {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sExecutor.execute(() -> {
|
||||
try {
|
||||
AppManager.getInstance().updateApp(packageName);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "onReceive: updateApp " + e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user