RK Android7.1 Settings 设置 内存条作假、隐藏开发者模式

设置里面 有关内存显示改成4G

一.packages\apps\Settings\res\xml\process_stats_summary.xml

    <PreferenceCategory
        android:title="@string/average_memory_use"
        android:layout="@layout/preference_category_short" />

    <com.android.settings.SummaryPreference
        android:key="status_header"
        android:selectable="false" /> 

二.内存 ProcessStatsSummary

--- a/packages/apps/Settings/src/com/android/settings/applications/ProcessStatsSummary.java
+++ b/packages/apps/Settings/src/com/android/settings/applications/ProcessStatsSummary.java
@@ -28,6 +28,7 @@ import com.android.settings.SummaryPreference;
 import com.android.settings.Utils;
 import com.android.settings.applications.ProcStatsData.MemInfo;
 import com.android.settings.dashboard.SummaryLoader;
+import android.util.Log;
 
 public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenceClickListener {
 
@@ -69,10 +70,13 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc
 
         double usedRam = memInfo.realUsedRam;
         double totalRam = memInfo.realTotalRam;
+		 double totalRam2 = totalRam*2;
         double freeRam = memInfo.realFreeRam;
         BytesResult usedResult = Formatter.formatBytes(context.getResources(), (long) usedRam,
                 Formatter.FLAG_SHORTER);
         String totalString = Formatter.formatShortFileSize(context, (long) totalRam);
+		Log.d("gatsby","totalString->"+totalString);
+		Log.d("gatsby","totalRam->"+(long) totalRam);
         String freeString = Formatter.formatShortFileSize(context, (long) freeRam);
         CharSequence memString;
         CharSequence[] memStatesStr = getResources().getTextArray(R.array.ram_states);
@@ -85,12 +89,17 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc
         mSummaryPref.setAmount(usedResult.value);
         mSummaryPref.setUnits(usedResult.units);
         float usedRatio = (float)(usedRam / (freeRam + usedRam));
-        mSummaryPref.setRatios(usedRatio, 0, 1 - usedRatio);
+		float usedRatio2 = usedRatio / 2;
+		//mSummaryPref.setRatios(usedRatio, 0, 1 - usedRatio);
+        mSummaryPref.setRatios(usedRatio2, 0, 1 - usedRatio2);
 
         mPerformance.setSummary(memString);
-        mTotalMemory.setSummary(totalString);
-        mAverageUsed.setSummary(Utils.formatPercentage((long) usedRam, (long) totalRam));
-        mFree.setSummary(freeString);
+        //mTotalMemory.setSummary(totalString);
+		mTotalMemory.setSummary("4GB");
+        //mAverageUsed.setSummary(Utils.formatPercentage((long) usedRam, (long) totalRam));
+		mAverageUsed.setSummary(Utils.formatPercentage((long) usedRam, ((long) totalRam)*2));
+        //mFree.setSummary(freeString);
+		mFree.setSummary("3GB");
         String durationString = getString(sDurationLabels[mDurationIndex]);
         int numApps = mStatsManager.getEntries().size();
         mAppListPreference.setSummary(getResources().getQuantityString(

 三.改完

  

 

四.隐藏开发者模式

packages\apps\Settings\src\com\android\settings\DeviceInfoSettings.java

将点击次数加大、Toast隐藏

static final int TAPS_TO_BE_A_DEVELOPER = 100;

mDevHitToast = Toast.makeText(getActivity(), getResources().getQuantityString(
                            R.plurals.show_dev_countdown, mDevHitCountdown, mDevHitCountdown),
                            Toast.LENGTH_SHORT);
                    mDevHitToast.show();

  

posted @ 2021-06-04 18:54  CrushGirl  阅读(627)  评论(0编辑  收藏  举报