feat: 系统功能抽象
This commit is contained in:
@@ -11,7 +11,6 @@ import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.ttstd.dialer.R;
|
||||
@@ -40,7 +39,7 @@ public class ApkUtils {
|
||||
pkgContext.startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
Log.e(TAG, "openPackage: can not open " + packageName);
|
||||
Logger.e(TAG, "openPackage: can not open " + packageName);
|
||||
Toaster.show("打开失败");
|
||||
return false;
|
||||
}
|
||||
@@ -96,7 +95,7 @@ public class ApkUtils {
|
||||
context.startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "openApp: " + e.getMessage());
|
||||
Logger.e(TAG, "openApp: " + e.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -166,7 +165,7 @@ public class ApkUtils {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
pi = pm.getPackageInfo(pkgName, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e("isSystemApp: ", "NameNotFoundException:" + e.getMessage());
|
||||
Logger.e("isSystemApp: ", "NameNotFoundException:" + e.getMessage());
|
||||
}
|
||||
// 是系统中已安装的应用
|
||||
if (pi != null) {
|
||||
@@ -185,7 +184,7 @@ public class ApkUtils {
|
||||
try {
|
||||
context.startActivity(storeIntent);
|
||||
} catch (Exception e1) {
|
||||
Log.e(TAG, "openWeixin storeIntent: " + e1.getMessage());
|
||||
Logger.e(TAG, "openWeixin storeIntent: " + e1.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user