import com.android.server.SystemService;
import java.io.FileDescriptor;
+import java.io.PrintWriter;
import java.util.Arrays;
/**
Binder.restoreCallingIdentity(callingId);
}
}
+
+ @Override
+ protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ if (getContext().checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
+ != PackageManager.PERMISSION_GRANTED) {
+
+ pw.println("Permission Denial: can't dump webviewupdate service from pid="
+ + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid());
+ return;
+ }
+
+ WebViewUpdateService.this.mImpl.dumpState(pw);
+ }
}
}
import android.webkit.WebViewProviderInfo;
import android.webkit.WebViewProviderResponse;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
mMinimumVersionCode = minimumVersionCode;
return mMinimumVersionCode;
}
+
+ public void dumpState(PrintWriter pw) {
+ synchronized (mLock) {
+ if (mCurrentWebViewPackage == null) {
+ pw.println(" Current WebView package is null");
+ } else {
+ pw.println(String.format(" Current WebView package (name, version): (%s, %s)",
+ mCurrentWebViewPackage.packageName,
+ mCurrentWebViewPackage.versionName));
+ }
+ pw.println(String.format(" Minimum WebView version code: %d",
+ mMinimumVersionCode));
+ pw.println(String.format(" Number of relros started: %d",
+ mNumRelroCreationsStarted));
+ pw.println(String.format(" Number of relros finished: %d",
+ mNumRelroCreationsFinished));
+ pw.println(String.format(" WebView package dirty: %b", mWebViewPackageDirty));
+ pw.println(String.format(" Any WebView package installed: %b",
+ mAnyWebViewInstalled));
+ }
+ }
}
private static boolean providerHasValidSignature(WebViewProviderInfo provider,
mSystemInterface.setMultiProcessEnabledFromContext(mContext);
}
}
+
+ /**
+ * Dump the state of this Service.
+ */
+ void dumpState(PrintWriter pw) {
+ pw.println("Current WebView Update Service state");
+ pw.println(String.format(" Fallback logic enabled: %b",
+ mSystemInterface.isFallbackLogicEnabled()));
+ mWebViewUpdater.dumpState(pw);
+ }
}