Merge "Change boot screen title to "Android is starting" when not upgrading." into lmp-mr1-dev
This commit is contained in:
@ -1609,6 +1609,18 @@ final class ApplicationPackageManager extends PackageManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
public boolean isUpgrade() {
|
||||
try {
|
||||
return mPM.isUpgrade();
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackageInstaller getPackageInstaller() {
|
||||
synchronized (mLock) {
|
||||
|
@ -436,6 +436,7 @@ interface IPackageManager {
|
||||
|
||||
boolean isFirstBoot();
|
||||
boolean isOnlyCoreApps();
|
||||
boolean isUpgrade();
|
||||
|
||||
void setPermissionEnforced(String permission, boolean enforced);
|
||||
boolean isPermissionEnforced(String permission);
|
||||
|
@ -3866,6 +3866,13 @@ public abstract class PackageManager {
|
||||
*/
|
||||
public abstract VerifierDeviceIdentity getVerifierDeviceIdentity();
|
||||
|
||||
/**
|
||||
* Returns true if the device is upgrading, such as first boot after OTA.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public abstract boolean isUpgrade();
|
||||
|
||||
/**
|
||||
* Return interface that offers the ability to install, upgrade, and remove
|
||||
* applications on the device.
|
||||
|
@ -3509,6 +3509,9 @@
|
||||
<!-- [CHAR LIMIT=40] Title of dialog that is shown when performing a system upgrade. -->
|
||||
<string name="android_upgrading_title">Android is upgrading\u2026</string>
|
||||
|
||||
<!-- [CHAR LIMIT=40] Title of dialog that is shown when system is starting. -->
|
||||
<string name="android_start_title">Android is starting\u2026</string>
|
||||
|
||||
<!-- [CHAR LIMIT=NONE] Message shown in upgrading dialog for each .apk that is optimized. -->
|
||||
<string name="android_upgrading_apk">Optimizing app
|
||||
<xliff:g id="number" example="123">%1$d</xliff:g> of
|
||||
|
@ -1491,6 +1491,7 @@
|
||||
<java-symbol type="layout" name="screen_title" />
|
||||
<java-symbol type="layout" name="screen_title_icons" />
|
||||
<java-symbol type="string" name="system_ui_date_pattern" />
|
||||
<java-symbol type="string" name="android_start_title" />
|
||||
<java-symbol type="string" name="android_upgrading_title" />
|
||||
<java-symbol type="string" name="bugreport_title" />
|
||||
<java-symbol type="string" name="bugreport_message" />
|
||||
|
@ -5352,7 +5352,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
mBootMsgDialog.setTitle(R.string.android_upgrading_title);
|
||||
if (mContext.getPackageManager().isUpgrade()) {
|
||||
mBootMsgDialog.setTitle(R.string.android_upgrading_title);
|
||||
} else {
|
||||
mBootMsgDialog.setTitle(R.string.android_start_title);
|
||||
}
|
||||
mBootMsgDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
mBootMsgDialog.setIndeterminate(true);
|
||||
mBootMsgDialog.getWindow().setType(
|
||||
|
@ -333,6 +333,7 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
final DisplayMetrics mMetrics;
|
||||
final int mDefParseFlags;
|
||||
final String[] mSeparateProcesses;
|
||||
final boolean mIsUpgrade;
|
||||
|
||||
// This is where all application persistent data goes.
|
||||
final File mAppDataDir;
|
||||
@ -1760,7 +1761,8 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
|
||||
// If this is first boot after an OTA, and a normal boot, then
|
||||
// we need to clear code cache directories.
|
||||
if (!Build.FINGERPRINT.equals(mSettings.mFingerprint) && !onlyCore) {
|
||||
mIsUpgrade = !Build.FINGERPRINT.equals(mSettings.mFingerprint);
|
||||
if (mIsUpgrade && !onlyCore) {
|
||||
Slog.i(TAG, "Build fingerprint changed; clearing code caches");
|
||||
for (String pkgName : mSettings.mPackages.keySet()) {
|
||||
deleteCodeCacheDirsLI(pkgName);
|
||||
@ -1800,6 +1802,11 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
return mOnlyCore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade() {
|
||||
return mIsUpgrade;
|
||||
}
|
||||
|
||||
private String getRequiredVerifierLPr() {
|
||||
final Intent verification = new Intent(Intent.ACTION_PACKAGE_NEEDS_VERIFICATION);
|
||||
final List<ResolveInfo> receivers = queryIntentReceivers(verification, PACKAGE_MIME_TYPE,
|
||||
|
@ -729,6 +729,14 @@ public class MockPackageManager extends PackageManager {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
public boolean isUpgrade() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
|
Reference in New Issue
Block a user