Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5379c4fe authored by David Brazdil's avatar David Brazdil Committed by android-build-merger
Browse files

Merge "Show hidden API warning once per process" am: 880839d2

am: 169a1592

Change-Id: I11b174f82b8a71884de6b384f9478d125ce45ab4
parents 0f63ca00 169a1592
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -7067,7 +7067,10 @@ public class Activity extends ContextThemeWrapper
        boolean isApiWarningEnabled = SystemProperties.getInt("ro.art.hiddenapi.warning", 0) == 1;
        boolean isApiWarningEnabled = SystemProperties.getInt("ro.art.hiddenapi.warning", 0) == 1;


        if (isAppDebuggable || isApiWarningEnabled) {
        if (isAppDebuggable || isApiWarningEnabled) {
            if (VMRuntime.getRuntime().hasUsedHiddenApi()) {
            if (!mMainThread.mHiddenApiWarningShown && VMRuntime.getRuntime().hasUsedHiddenApi()) {
                // Only show the warning once per process.
                mMainThread.mHiddenApiWarningShown = true;

                String appName = getApplicationInfo().loadLabel(getPackageManager())
                String appName = getApplicationInfo().loadLabel(getPackageManager())
                        .toString();
                        .toString();
                String warning = "Detected problems with API compatiblity\n"
                String warning = "Detected problems with API compatiblity\n"
+1 −0
Original line number Original line Diff line number Diff line
@@ -266,6 +266,7 @@ public final class ActivityThread {
    boolean mJitEnabled = false;
    boolean mJitEnabled = false;
    boolean mSomeActivitiesChanged = false;
    boolean mSomeActivitiesChanged = false;
    boolean mUpdatingSystemConfig = false;
    boolean mUpdatingSystemConfig = false;
    /* package */ boolean mHiddenApiWarningShown = false;


    // These can be accessed by multiple threads; mResourcesManager is the lock.
    // These can be accessed by multiple threads; mResourcesManager is the lock.
    // XXX For now we keep around information about all packages we have
    // XXX For now we keep around information about all packages we have