mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
add and use isGooglePlayApp()
This commit is contained in:
parent
710f9c68ff
commit
e72beaa265
2 changed files with 14 additions and 4 deletions
|
@ -108,12 +108,12 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
|
|||
JSONObject params = new JSONObject();
|
||||
PackageManager pm = context.getPackageManager();
|
||||
String packageName = context.getPackageName();
|
||||
String installer = pm.getInstallerPackageName( packageName );
|
||||
|
||||
if ( "com.google.android.feedback".equals( installer )
|
||||
|| "com.android.vending".equals( installer ) ) {
|
||||
// Do nothing; it's a Market app
|
||||
if ( Utils.isGooglePlayApp( context ) ) {
|
||||
// Do nothing
|
||||
} else {
|
||||
String installer = pm.getInstallerPackageName( packageName );
|
||||
|
||||
try {
|
||||
int versionCode = pm.getPackageInfo( packageName, 0 ).versionCode;
|
||||
|
||||
|
|
|
@ -464,6 +464,16 @@ public class Utils {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static boolean isGooglePlayApp( Context context )
|
||||
{
|
||||
PackageManager pm = context.getPackageManager();
|
||||
String packageName = context.getPackageName();
|
||||
String installer = pm.getInstallerPackageName( packageName );
|
||||
boolean result = "com.google.android.feedback".equals( installer )
|
||||
|| "com.android.vending".equals( installer );
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void setFirstBootStatics( Context context )
|
||||
{
|
||||
int thisVersion = getAppVersion( context );
|
||||
|
|
Loading…
Reference in a new issue