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

Commit a768729b authored by Josh Guilfoyle's avatar Josh Guilfoyle
Browse files

THEMES-177: Added Java API to temporarily manipulate activity configChanges.

This hack is designed to avoid adding a new flag value to
attrs_manifest.xml for "theme" configChange, which will add a new R.id
value and destabalize aapt's enumeration.  Not a perfect replacement
however as modifying the ActivityInfo in this way only applies to the
current Activity instance.  Other components querying the PackageManager
would not see the revised configChanges value, nor would a separate
instance of the same Activity.

CR: Dirk Sigurdson
CR: Ed Carrigan
parent a72bc187
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -3828,4 +3828,26 @@ public class Activity extends ContextThemeWrapper
            onActivityResult(requestCode, resultCode, data);
        }
    }

    /**
     * Adjusts the configChanges value attached to this Activity, OR'ing the
     * current value with the specified flag.
     *
     * @hide Added by T-Mobile to avoid adding a "theme" flag to the
     *       "configChanges" manifest attribute.
     */
    public void setConfigChangesFlag(int flag) {
        mActivityInfo.configChanges |= flag;
    }

    /**
     * Adjusts the configChanges value attached to this Activity, removing the
     * specified flag from the current value.
     *
     * @hide Added by T-Mobile to avoid adding a "theme" flag to the
     *       "configChanges" manifest attribute.
     */
    public void unsetConfigChangesFlag(int flag) {
        mActivityInfo.configChanges &= ~flag;
    }
}