提交 2d541dd5 编写于 作者: T Todd Volkert 提交者: GitHub

Only handle refresh intent when the app is marked as debuggable. (#3752)

上级 1f765cdb
......@@ -7,6 +7,7 @@ package io.flutter.app;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
......@@ -153,7 +154,9 @@ public final class FlutterActivityDelegate
@Override
public void onNewIntent(Intent intent) {
if (!loadIntent(intent)) {
// Only attempt to reload the Flutter Dart code during development. Use
// the debuggable flag as an indicator that we are in development mode.
if (!isDebuggable() || !loadIntent(intent)) {
for (NewIntentListener listener : newIntentListeners) {
if (listener.onNewIntent(intent)) {
return;
......@@ -162,6 +165,10 @@ public final class FlutterActivityDelegate
}
}
private boolean isDebuggable() {
return (activity.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
}
@Override
public void onPause() {
if (flutterView != null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册