am 2e3c7509: Make settings a little aware of multi-user install.

* commit '2e3c75094bde1cfca1b15f66f5ff3d0a85baf0a0':
  Make settings a little aware of multi-user install.
This commit is contained in:
Dianne Hackborn
2012-08-24 14:40:15 -07:00
committed by Android Git Automerger
2 changed files with 11 additions and 0 deletions

View File

@@ -2426,6 +2426,8 @@
<string name="external_data_size_label" product="default">SD card</string> <string name="external_data_size_label" product="default">SD card</string>
<!-- Manage applications, individual application info screen, button label under Storage heading. Button to remove the application from the system. --> <!-- Manage applications, individual application info screen, button label under Storage heading. Button to remove the application from the system. -->
<string name="uninstall_text">Uninstall</string> <string name="uninstall_text">Uninstall</string>
<!-- [CHAR LIMIT=NONE] Manage applications, individual application info screen, button label under Storage heading. Button to install an application for the user. -->
<string name="install_text">Install</string>
<!-- [CHAR LIMIT=25] Manage applications, individual application info screen, button label under Storage heading. Button to disable an existing application. --> <!-- [CHAR LIMIT=25] Manage applications, individual application info screen, button label under Storage heading. Button to disable an existing application. -->
<string name="disable_text">Disable</string> <string name="disable_text">Disable</string>
<!-- [CHAR LIMIT=25] Manage applications, individual application info screen, button label under Storage heading. Button to re-enable an existing application. --> <!-- [CHAR LIMIT=25] Manage applications, individual application info screen, button label under Storage heading. Button to re-enable an existing application. -->

View File

@@ -322,6 +322,9 @@ public class InstalledAppDetails extends Fragment
Log.w(TAG, "Unable to get package info", e); Log.w(TAG, "Unable to get package info", e);
} }
} }
} else if ((mPackageInfo.applicationInfo.flags
& ApplicationInfo.FLAG_INSTALLED) == 0) {
mUninstallButton.setText(R.string.install_text);
} else { } else {
mUninstallButton.setText(R.string.uninstall_text); mUninstallButton.setText(R.string.uninstall_text);
} }
@@ -1042,6 +1045,12 @@ public class InstalledAppDetails extends Fragment
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
.execute((Object)null); .execute((Object)null);
} }
} else if ((mAppEntry.info.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {
try {
mPm.installExistingPackage(packageName);
refreshUi();
} catch (NameNotFoundException e) {
}
} else { } else {
uninstallPkg(packageName); uninstallPkg(packageName);
} }