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

This commit is contained in:
Todd Volkert
2017-06-08 08:13:52 -07:00
committed by GitHub
parent a7a3027d76
commit 17c9a56d2e

View File

@@ -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) {