Skip to content

Allow factory reset without PERSISTENT_DATA_BLOCK_SERVICE#1

Open
benys wants to merge 17 commits intoBlissOS:typhoon-x86from
benys:typhoon-x86
Open

Allow factory reset without PERSISTENT_DATA_BLOCK_SERVICE#1
benys wants to merge 17 commits intoBlissOS:typhoon-x86from
benys:typhoon-x86

Conversation

@benys
Copy link

@benys benys commented Apr 22, 2024

Currently factory reset action is ignored if
PERSISTENT_DATA_BLOCK_SERVICE isn't presented on device. Make sure that we can execute regular factory reset without it by utilizing the logic from shouldWipePersistentDataBlock.

Test: manual verify on aosp build
Bug: 129137473
Bug: 196634851
Change-Id: I2abcb93cbc0872dd920c1dd62152596ddd723691

cwhuang and others added 17 commits January 31, 2026 22:45
Add an item to display manufacturer in hardware info page.

Change-Id: I62e7d55417ac728e0917fabcbae89683a1f6f4f3
In order to get Mesa / OpenGL ES info, an EGL context is required.
Without it, GLES20.glGetString returns NULL.

Change-Id: I3d95f9c1ee7d2df707ac2ccfcad5b0b5821f8fda
Since setprop ro.serialno can break GMS, we decided to put serial number
in our own property instead.

Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
"SoC Model" will change to "CPU Model" because we don't just use SoC
here. Also use a new custom property to get the CPU Model instead.

Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
On About Phone/Tablet :
- Replace BlissROM logo with BlissOS, and let it use monet color.
- For the preview screen, use a horizontal 16:9 screen instead of
vertical 21:9 like on BlissROM, also replace with BlissOS logo.

Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
getRealSize() will get the whole screen resolution so we don't have
to add extra height checking in

Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
This is more like a preference, I like to see the resolution when
the screen is in landscape, even on phones

Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
This include bypassing the alert window permission and also the ability
to allow apps to draw on other apps. We need it for apps like Smart Dock.

Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Change-Id: Ic8e97b78f19e59fe108c7c3304dfe7e7f49020a9
Signed-off-by: Mohammad Hasan Keramat J <ikeramat@protonmail.com>
Currently factory reset action is ignored if
PERSISTENT_DATA_BLOCK_SERVICE isn't presented on device.
Make sure that we can execute regular factory reset without
it by utilizing the logic from shouldWipePersistentDataBlock.

Test: manual verify on aosp build
Bug: 129137473
Bug: 196634851
Change-Id: I2abcb93cbc0872dd920c1dd62152596ddd723691
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
Copilot AI review requested due to automatic review settings January 31, 2026 21:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request claims to "Allow factory reset without PERSISTENT_DATA_BLOCK_SERVICE" but actually bundles multiple unrelated feature changes together. The PR includes: (1) a factory reset fix for devices without persistent data block support, (2) network setup wizard integration for OOBE (out-of-box experience), (3) changes to CPU/SoC device information display logic with breaking property name changes, (4) new OpenGL version display with resource management issues, and (5) various UI updates including layout changes and new drawables.

Changes:

  • Factory reset now handles null PersistentDataBlockManager correctly when service is unavailable
  • Setup wizard integration added for NetworkProviderSettings with GlifPreferenceLayout support
  • CPU/SoC property names changed from standard Android properties to custom "ro.bliss.cpuname" property
  • New device info controllers added (manufacturer, OpenGL version, serial number)
  • UI updates including layout orientation changes, new icons, and updated branding

Reviewed changes

Copilot reviewed 101 out of 102 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
MainClearConfirm.java Allows factory reset to proceed when PERSISTENT_DATA_BLOCK_SERVICE is unavailable
NetworkProviderSettings.java Adds setup wizard detection and UI adaptations for OOBE flow
NetworkSetupActivity.java New activity for network setup in setup wizard with proper theme and intent filters
BlissSpecUtils.java Changes CPU model property from ro.soc.model to ro.bliss.cpuname, removes fallback
SoCModelPreferenceController.java Replaces Android Build.SOC_* API usage with custom property
OpenGLVersionPreferenceController.java New controller to display OpenGL info with EGL initialization (has resource leaks)
DeviceManufacturerPreferenceController.java New controller using Build.MANUFACTURER
BlissSerialNumberPreferenceController.java New controller for device serial number
Utils.java Adds bypass setting for system alert window on low RAM devices
AndroidManifest.xml Registers NetworkSetupActivity for setup wizard
Android.bp Adds SystemUISharedLib dependency
Multiple XML/drawable/string files UI resource updates, translations, and layout changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +89 to +96
final PersistentDataBlockManager pdbManager;
// pre-flight check hardware support PersistentDataBlockManager
if (SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
return;
}

final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager)
if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
pdbManager = (PersistentDataBlockManager)
getActivity().getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
} else {
pdbManager = null;
}
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title and description focus on allowing factory reset without PERSISTENT_DATA_BLOCK_SERVICE, but the vast majority of changes in this PR are unrelated to factory reset. The actual changes include:

  1. Factory reset fix (MainClearConfirm.java) - matches PR description
  2. Network setup wizard integration (NetworkProviderSettings.java, NetworkSetupActivity.java) - NOT mentioned in PR description
  3. CPU/device info property changes (BlissSpecUtils.java, SoCModelPreferenceController.java, etc.) - NOT mentioned in PR description
  4. UI/resource updates (multiple drawable and string files) - NOT mentioned in PR description

This appears to be multiple unrelated features bundled into a single PR, which makes review difficult and increases risk. These changes should be split into separate PRs.

Copilot uses AI. Check for mistakes.
final int[] configSpec = { EGL10.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE };
if (egl.eglChooseConfig(eglDisplay, configSpec, eglConfigs, 1, iparam) && iparam[0] > 0) {
// create surface
SurfaceTexture surfaceTexture = new SurfaceTexture(0);
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SurfaceTexture created at line 78 is never released. SurfaceTexture holds native resources that need to be explicitly released by calling release(). This can lead to resource leaks. The surfaceTexture.release() method should be called in the cleanup section along with the EGL resource cleanup.

Copilot uses AI. Check for mistakes.
Comment on lines +100 to +102
mResult = "GL Vendor: " + GLES20.glGetString(GLES20.GL_VENDOR) + "\n" +
"GL Renderer: " + GLES20.glGetString(GLES20.GL_RENDERER) + "\n" +
"GL Version: " + GLES20.glGetString(GLES20.GL_VERSION);
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If any EGL initialization step fails (eglGetDisplay, eglInitialize, eglChooseConfig, etc.), the code continues to call GLES20.glGetString() at lines 100-102. These calls will fail or return null/invalid values when no valid GL context is active, potentially causing the mResult string to contain "null" values. The code should check if a valid GL context was successfully created before calling glGetString(), and provide a meaningful fallback message if initialization failed.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to 46
return SystemProperties.get("ro.bliss.cpuname");
}
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire SoC display logic has been replaced. The original code used Build.SOC_MODEL and Build.SOC_MANUFACTURER from the Android framework, with a fallback to "ro.board.platform". The new code only checks "ro.bliss.cpuname". This is a breaking change that removes standard Android API usage in favor of a custom property. This change could break SoC display on many devices and should either maintain the original logic as a fallback or be documented as an intentional breaking change with migration instructions.

Copilot uses AI. Check for mistakes.
android:gravity="center"
android:elevation="0dp"
android:contentDescription="@null"
android:orientation="horizontal" />
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The orientation is being changed from "vertical" to "horizontal" without explanation. This changes the layout behavior significantly. Please verify that this change is intentional and correctly renders the about phone UI on all device form factors.

Copilot uses AI. Check for mistakes.
Comment on lines +104 to +108
if (eglContext != null) {
egl.eglMakeCurrent(eglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
egl.eglDestroyContext(eglDisplay, eglContext);
egl.eglDestroySurface(eglDisplay, eglSurface);
}
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup section only destroys eglSurface if eglContext is not null. However, eglSurface could have been successfully created even if eglContext creation failed. This means the surface would leak in error scenarios. The cleanup logic should check eglSurface independently of eglContext and destroy it if it's valid.

Copilot uses AI. Check for mistakes.
private static final String DEVICE_NAME_MODEL_PROPERTY = "ro.product.system.model";
private static final String BLISS_CPU_MODEL_PROPERTY = "ro.soc.model";
private static final String FALLBACK_CPU_MODEL_PROPERTY = "ro.board.platform";
private static final String BLISS_CPU_MODEL_PROPERTY = "ro.bliss.cpuname";
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CPU model property name is being changed from "ro.soc.model" to "ro.bliss.cpuname". This is a breaking change that will cause the CPU model to not display correctly on devices that use "ro.soc.model" property. The fallback to "ro.board.platform" is also being removed. This change should either maintain backward compatibility with the old property names, or be coordinated with device configuration changes across the entire codebase. Note that SpecsPreferenceController.java in firmwareversion still references "ro.soc.model".

Copilot uses AI. Check for mistakes.
Comment on lines 93 to 99
public static String getProcessorModel() {
String cpuModelBliss = SystemProperties.get(BLISS_CPU_MODEL_PROPERTY);
String cpuModelFallback = SystemProperties.get(FALLBACK_CPU_MODEL_PROPERTY);
if (!cpuModelBliss.isEmpty()) {
return cpuModelBliss;
} else if (!cpuModelFallback.isEmpty()) {
return cpuModelFallback;
} else {
return "unknown";
}
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the fallback logic that checked both "ro.soc.model" and "ro.board.platform" properties reduces robustness. Many devices may not have the "ro.bliss.cpuname" property set, and will now show "unknown" instead of falling back to alternative properties. Consider keeping fallback logic to maintain compatibility across different device configurations.

Copilot uses AI. Check for mistakes.
Comment on lines 33 to +40
<com.android.utils.aboutWallpaperView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:gravity="center"
android:elevation="0dp"
android:contentDescription="@null"
android:orientation="vertical" />
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:gravity="center"
android:elevation="0dp"
android:contentDescription="@null"
android:orientation="horizontal" />
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is inconsistent in this file. Lines 35-40 use spaces for indentation while the rest of the file appears to use tabs. The code should use consistent indentation throughout the file.

Copilot uses AI. Check for mistakes.
}

final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager)
if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inefficient comparison to empty string, check for zero length instead.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants