Skip to content

Commit

Permalink
use mContext
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredmixpanel committed Jan 30, 2025
1 parent fcab91f commit a9f93b0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ private SystemInformation(Context context) {
mHasTelephony = foundTelephony;
mDisplayMetrics = new DisplayMetrics();

DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
DisplayManager displayManager = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
Display display = (displayManager != null) ? displayManager.getDisplay(Display.DEFAULT_DISPLAY) : null;

if (display != null) {
display.getMetrics(mDisplayMetrics);
} else {
DisplayMetrics defaultMetrics = context.getResources().getDisplayMetrics();
DisplayMetrics defaultMetrics = mContext.getResources().getDisplayMetrics();
mDisplayMetrics.setTo(defaultMetrics);
}
}
Expand Down

0 comments on commit a9f93b0

Please sign in to comment.