This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/force-app/main/default/lwc/editAccountRecord/editAccountRecord.html b/force-app/main/default/lwc/editAccountRecord/editAccountRecord.html | |
index 5c58aa1..8fc23c6 100644 | |
--- a/force-app/main/default/lwc/editAccountRecord/editAccountRecord.html | |
+++ b/force-app/main/default/lwc/editAccountRecord/editAccountRecord.html | |
@@ -27,20 +27,6 @@ | |
<!-- input fields --> | |
<lightning-input-field field-name={nameField}></lightning-input-field> | |
- | |
- <!-- Disable the button if LocationService isn't available --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyActivity : Activity() { | |
override fun onResume() { | |
super.onResume() | |
// AppCenter stores the stack trace for previous crashes | |
if (Crashes.hasCrashedInLastSession().get()) { | |
val report = Crashes.getLastSessionCrashReport().get() | |
val oom = report.stackTrace.substringBefore("\n").contains("OutOfMemory") | |
if (oom) { | |
eventLogger.reportAppCrashFromOOM() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyWebViewClient : WebViewClient() { | |
@RequiresApi(Build.VERSION_CODES.O) | |
override fun onRenderProcessGone(view: WebView, | |
detail: RenderProcessGoneDetail): Boolean { | |
eventLogger.reportWebViewRenderProcessGone(detail.didCrash()) | |
return super.onRenderProcessGone(view, detail) | |
} | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyHybridExtension { | |
val job = SupervisorJob() | |
var scope = CoroutineScope(Dispatchers.IO + job) | |
@JavascriptInterface | |
fun getContact(contactId: String, callbackId: String) = scope.launch { | |
try { | |
val contact: String = fetchContact(contactId) | |
callback(callbackId, contact) | |
} catch (e: OutOfMemoryError) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyActivity : Activity() { | |
override fun onTrimMemory(level: Int) { | |
super.onTrimMemory(level) | |
// Intermediate levels may be added later, so use ranged conditionals | |
if (level >= TRIM_MEMORY_COMPLETE || | |
level in TRIM_MEMORY_RUNNING_CRITICAL until TRIM_MEMORY_UI_HIDDEN) { | |
imageCache.clear() | |
webAppMgr.onLowMemory(level) | |
eventLogger.reportLowMemory(level) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class SafeJobIntentService extends JobIntentService { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
if (Build.VERSION.SDK_INT >= 26) { | |
mJobImpl = new androidx.core.app.SafeJobServiceEngineImpl(this); | |
} else { | |
mJobImpl = null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onActivityPaused(Activity activity) { | |
if (activity.getIntent() == null | |
|| !activity.getIntent().getBooleanExtra(BackgroundJobService.SKIP_BG_CHECK, false)) { | |
BackgroundJobService.enqueueWork(activity); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Flag the current activity to skip background check upon pause | |
activity.getIntent().putExtra(BackgroundJobService.SKIP_BG_CHECK, true); | |
// Launch the Camera app to take a picture | |
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
activity.startActivityForResult(intent, ActivityRequests.TAKE_PICTURE_REQUEST); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BackgroundJobService extends JobIntentService { | |
public static final int JOB_ID = 1000; | |
public static volatile boolean shouldContinue = false; | |
private static final Object lock = new Object(); | |
private static final long BACKGROUND_TIMEOUT_WAIT_MS = 5000; | |
final Handler mHandler = new Handler(); | |
public static void enqueueWork(Context context) { | |
Intent bgJobService = new Intent(context, BackgroundJobService.class); | |
BackgroundJobService.enqueueWork( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<application | |
android:name=".DetectBackgroundApp" | |
... | |
> | |
... | |
<service | |
android:name=".BackgroundJobService" | |
android:permission="android.permission.BIND_JOB_SERVICE" /> | |
... | |
</application> |
NewerOlder