(final Context context, final Surface surface, Rect surfaceFrame, int surfaceDpi)
| 142 | } |
| 143 | |
| 144 | public void onSurfaceCreated(final Context context, final Surface surface, Rect surfaceFrame, int surfaceDpi) |
| 145 | { |
| 146 | assert mLocationHelper != null : "LocationHelper must be initialized before calling onSurfaceCreated"; |
| 147 | |
| 148 | if (isThemeChangingProcess()) |
| 149 | { |
| 150 | Logger.d(TAG, "Theme changing process, skip 'onSurfaceCreated' callback"); |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | Logger.d(TAG, "mSurfaceCreated = " + mSurfaceCreated); |
| 155 | if (nativeIsEngineCreated()) |
| 156 | { |
| 157 | if (sCurrentDpi != surfaceDpi) |
| 158 | { |
| 159 | nativeUpdateEngineDpi(surfaceDpi); |
| 160 | sCurrentDpi = surfaceDpi; |
| 161 | |
| 162 | setupWidgets(context, surfaceFrame.width(), surfaceFrame.height()); |
| 163 | } |
| 164 | if (!nativeAttachSurface(surface)) |
| 165 | { |
| 166 | if (mCallbackUnsupported != null) |
| 167 | mCallbackUnsupported.report(); |
| 168 | return; |
| 169 | } |
| 170 | mSurfaceCreated = true; |
| 171 | mSurfaceAttached = true; |
| 172 | mRequireResize = true; |
| 173 | nativeResumeSurfaceRendering(); |
| 174 | return; |
| 175 | } |
| 176 | |
| 177 | mRequireResize = false; |
| 178 | setupWidgets(context, surfaceFrame.width(), surfaceFrame.height()); |
| 179 | |
| 180 | final boolean firstStart = mLocationHelper.isInFirstRun(); |
| 181 | if (!nativeCreateEngine(surface, surfaceDpi, firstStart, mLaunchByDeepLink, Config.getVersionCode(), |
| 182 | ROMUtils.isCustomROM())) |
| 183 | { |
| 184 | if (mCallbackUnsupported != null) |
| 185 | mCallbackUnsupported.report(); |
| 186 | return; |
| 187 | } |
| 188 | sCurrentDpi = surfaceDpi; |
| 189 | |
| 190 | if (firstStart) |
| 191 | UiThread.runLater(mLocationHelper::onExitFromFirstRun); |
| 192 | |
| 193 | mSurfaceCreated = true; |
| 194 | mSurfaceAttached = true; |
| 195 | nativeResumeSurfaceRendering(); |
| 196 | if (mMapRenderingListener != null) |
| 197 | mMapRenderingListener.onRenderingCreated(); |
| 198 | } |
| 199 | |
| 200 | public void onSurfaceChanged(final Context context, final Surface surface, Rect surfaceFrame, |
| 201 | boolean isSurfaceCreating) |
no test coverage detected