Skip to content

Instantly share code, notes, and snippets.

@steadfasterX
Last active January 20, 2024 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steadfasterX/f03339d23cf234df1a7958fab6285d9b to your computer and use it in GitHub Desktop.
Save steadfasterX/f03339d23cf234df1a7958fab6285d9b to your computer and use it in GitHub Desktop.
frameworks/base/services/core/java/com/android/server/wm/AppWarnings.java
/**
* Shows the "deprecated abi" warning, if necessary.
*
* @param r activity record for which the warning may be displayed
*/
public void showDeprecatedAbiDialogIfNeeded(ActivityRecord r) {
final String appAbi = r.info.applicationInfo.primaryCpuAbi;
final boolean is64BitArmDevice = Arrays.stream(Build.SUPPORTED_64_BIT_ABIS).anyMatch("arm64-v8a"::equals);
Log.w(TAG, "before: is64BitArmDevice: " + String.valueOf(is64BitArmDevice));
Log.w(TAG, "before: appAbi: " + appAbi);
if (is64BitArmDevice && appAbi != null && appAbi != "arm64-v8a") {
Log.w(TAG, "within: is64BitArmDevice: " + String.valueOf(is64BitArmDevice));
Log.w(TAG, "within: appAbi: " + appAbi);
mUiHandler.showDeprecatedAbiDialog(r);
}
}
frameworks/base/services/core/java/com/android/server/wm/AppWarnings.java
/**
* Shows the "deprecated abi" warning, if necessary.
*
* @param r activity record for which the warning may be displayed
*/
public void showDeprecatedAbiDialogIfNeeded(ActivityRecord r) {
final String appAbi = r.info.applicationInfo.primaryCpuAbi;
final boolean is64BitArmDevice = Arrays.stream(Build.SUPPORTED_64_BIT_ABIS).anyMatch("arm64-v8a"::equals);
Log.w(TAG, "before: is64BitArmDevice: " + String.valueOf(is64BitArmDevice));
Log.w(TAG, "before: appAbi: " + appAbi);
if (is64BitArmDevice && appAbi != null && !appAbi.equals("arm64-v8a")) {
Log.w(TAG, "within: is64BitArmDevice: " + String.valueOf(is64BitArmDevice));
Log.w(TAG, "within: appAbi: " + appAbi);
mUiHandler.showDeprecatedAbiDialog(r);
}
}
@steadfasterX
Copy link
Author

steadfasterX commented Dec 6, 2023

result AppWarnings.java

12-06 14:47:06.514 3800 5993 W AppWarnings: before: is64BitArmDevice: true
12-06 14:47:06.514 3800 5993 W AppWarnings: before: appAbi: arm64-v8a
12-06 14:47:06.514 3800 5993 W AppWarnings: within: is64BitArmDevice: true
12-06 14:47:06.514 3800 5993 W AppWarnings: within: appAbi: arm64-v8a
12-06 14:47:06.586 3800 3819 W ActivityTaskManager: Showing ABI deprecation warning for package us.spotco.fennec_dos

(32bit popup)

@steadfasterX
Copy link
Author

steadfasterX commented Dec 6, 2023

result AppWarnings_fixed.java:

12-06 15:15:19.566 3797 4170 W AppWarnings: before: is64BitArmDevice: true
12-06 15:15:19.566 3797 4170 W AppWarnings: before: appAbi: arm64-v8a

(no popup)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment