remove unused app.uninstallable

app.uninstallable is only used in AppDetails.  It is only set when
generating App instances from installed APKs for the swap stuff. Since it
is initialized to false and used as !app.uninstallable, it is always true
when used.  So it was doing nothing.

This needs to be thought out more so this is not entirely complete for
#628. AppDetails needs to know whether its a system app to provide proper
feedback and swap needs to know whether its a system app with an update
installed, otherwise it should ignore it.
This commit is contained in:
Hans-Christoph Steiner 2016-05-27 21:40:10 +02:00
parent f7688d7f9a
commit 1914f5f3e1
2 changed files with 0 additions and 8 deletions

View File

@ -1571,9 +1571,6 @@ public class AppDetails extends AppCompatActivity {
btMain.setText(R.string.menu_launch);
} else {
btMain.setText(R.string.menu_uninstall);
if (!app.uninstallable) {
btMain.setVisibility(View.GONE);
}
}
}
btMain.setOnClickListener(mOnClickListener);

View File

@ -129,8 +129,6 @@ public class App extends ValueObject implements Comparable<App> {
public String installedSig;
public boolean uninstallable;
public static String getIconName(String packageName, int versionCode) {
return packageName + "_" + versionCode + ".png";
}
@ -314,9 +312,6 @@ public class App extends ValueObject implements Comparable<App> {
this.name = (String) appInfo.loadLabel(pm);
this.icon = getIconName(packageName, packageInfo.versionCode);
this.compatible = true;
boolean system = (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
boolean updatedSystemApp = (appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
this.uninstallable = !system || updatedSystemApp;
}
private void initApkFromApkFile(Context context, Apk apk, PackageInfo packageInfo, SanitizedFile apkFile)