There are multiple animations or functions on Android Go low memory devices. IsLowRamDeviceStatic () is not enabled by default

Android Go low-memory devices have multiple animations or functions that are not enabled by default

For example, application windowing function,

res/values-zh-rCN/strings.xml:4323:    

<string msgid = "3557117039415422481" name = "disabled_feature_reason_slow_down_phone"> "Because this feature will slow down your phone, this feature has been turned off" </ string>

res/layout/manage_applications_apps_unsupported.xml:43:            android:text="@string/disabled_feature_reason_slow_down_phone"
 
src/com/android/settings/applications/manageapplications/ManageApplications.java:337:            
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        if (mListType == LIST_TYPE_OVERLAY && !Utils.isSystemAlertWindowEnabled(getContext())) {
            mRootView = inflater.inflate(R.layout.manage_applications_apps_unsupported, null);
            setHasOptionsMenu (false);
            return mRootView;
        }
......
 
查看packages/apps/Settings/src/com/android/settings/Utils.java
    /**
     * Returns true if SYSTEM_ALERT_WINDOW permission is available.
     * Starting from Q, SYSTEM_ALERT_WINDOW is disabled on low ram phones.
     */
    public static boolean isSystemAlertWindowEnabled(Context context) {
        // SYSTEM_ALERT_WINDOW is disabled on on low ram devices starting from Q
        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        return !(am.isLowRamDevice() && (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q));
    }
According to the notes, starting with Android Q, the SYSTEM_ALERT_WINDOW system pop-up window is forbidden on low memory devices
 
frameworks/base/core/java/android/app/ActivityManager.java
 
    private static final boolean DEVELOPMENT_FORCE_LOW_RAM =
            SystemProperties.getBoolean("debug.force_low_ram", false);
 
    /**
     * Returns true if this is a low-RAM device.  Exactly whether a device is low-RAM
     * is ultimately up to the device configuration, but currently it generally means
     * something with 1GB or less of RAM.  This is mostly intended to be used by apps
     * to determine whether they should turn off certain features that require more RAM.
     */
    public boolean isLowRamDevice() {
        return isLowRamDeviceStatic();
    }
 
    /** @hide */
    @UnsupportedAppUsage
    public static boolean isLowRamDeviceStatic() {
        return RoSystemProperties.CONFIG_LOW_RAM ||
                (Build.IS_DEBUGGABLE && DEVELOPMENT_FORCE_LOW_RAM);
    }
 
frameworks/base/core/java/com/android/internal/os/RoSystemProperties.java
    public static final boolean CONFIG_LOW_RAM =
            SystemProperties.getBoolean("ro.config.low_ram", false);
 
frameworks/base/core/java/android/os/Build.java
    /**
     * Returns true if we are running a debug build such as "user-debug" or "eng".
     * @hide
     */
    public static final boolean IS_DEBUGGABLE =
            SystemProperties.getInt("ro.debuggable", 0) == 1;
 
The relevant properties SystemProperties setting for the above low memory version
Published 31 original articles · Likes6 · Visitors 10,000+

Guess you like

Origin blog.csdn.net/u012824529/article/details/103776971