增加定位和天气依赖

This commit is contained in:
2025-11-04 19:19:33 +08:00
parent 9ac7cf86f3
commit 02772c241e
9 changed files with 302 additions and 4 deletions

View File

@@ -0,0 +1,40 @@
package com.ttstd.dialer.receiver;
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;
public class AppChangedReceiver extends BroadcastReceiver {
private static final String TAG = "ApkInstallReceiver";
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
@Override
public void onReceive(final Context context, Intent intent) {
String action = intent.getAction();
Log.e(TAG, "onReceive: " + "action = " + action);
if (TextUtils.isEmpty(action)) {
return;
}
String packageName = intent.getDataString().replace("package:", "");
switch (action) {
case Intent.ACTION_PACKAGE_ADDED:
Log.e(TAG, "onReceive: added " + packageName);
break;
case Intent.ACTION_PACKAGE_REPLACED:
Log.e(TAG, "onReceive: replaced " + packageName);
break;
case Intent.ACTION_PACKAGE_REMOVED:
Log.e(TAG, "onReceive: removed " + packageName);
break;
default:
break;
}
}
}