Skip to content

Commit eb4f6db

Browse files
authored
fix(reviewer): address review comments on server binding, permissions, immersive mode, and intent extras
1 parent e1aad34 commit eb4f6db

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎ApiDemos/project/java-app/src/main/java/com/example/mapdemo/SamplesBaseActivity.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ public void onWindowFocusChanged(boolean hasFocus) {
8686
}
8787

8888
private void applyImmersiveStickyMode() {
89+
if (!isReviewerMode()) {
90+
return;
91+
}
8992
WindowInsetsControllerCompat insetsController =
9093
WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView());
9194
insetsController.setSystemBarsBehavior(

‎ApiDemos/project/kotlin-app/src/androidTest/java/com/example/kotlindemos/BasicMapReviewerUiTest.kt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ class BasicMapReviewerUiTest {
3737

3838
@Test
3939
fun testBasicMapHasReviewerToolbarActions() {
40-
val scenario = ActivityScenario.launch(BasicMapDemoActivity::class.java)
40+
val context = InstrumentationRegistry.getInstrumentation().targetContext
41+
val intent = Intent(context, BasicMapDemoActivity::class.java).apply {
42+
putExtra("extra_sample_id", "com.example.kotlindemos.BasicMapDemoActivity")
43+
putExtra("extra_is_reviewer_mode", true)
44+
}
45+
val scenario = ActivityScenario.launch<BasicMapDemoActivity>(intent)
4146

4247
scenario.onActivity { activity ->
4348
val toolbar = activity.findViewById<MaterialToolbar>(R.id.top_bar)

‎ApiDemos/project/kotlin-app/src/main/java/com/example/kotlindemos/SamplesBaseActivity.kt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ open class SamplesBaseActivity : AppCompatActivity() {
7575
}
7676

7777
private fun applyImmersiveStickyMode() {
78+
if (!isReviewerMode) return
7879
val insetsController = WindowCompat.getInsetsController(window, window.decorView)
7980
insetsController.systemBarsBehavior =
8081
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE

‎ApiDemos/project/reviewer/src/main/res/xml/file_paths.xml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@
1717

1818
<paths xmlns:android="http://schemas.android.com/apk/res/android">
1919
<external-files-path name="reports" path="reports" />
20-
<external-files-path name="external_files" path="." />
21-
<files-path name="internal_files" path="." />
22-
<cache-path name="internal_cache" path="." />
2320
</paths>

‎test/server.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,16 +341,17 @@ def update_markdown_task_list(db_data):
341341

342342
if __name__ == "__main__":
343343
parser = argparse.ArgumentParser(description="Interactive API Server for Maps SDK Review Dashboard.")
344+
parser.add_argument("--host", type=str, default="127.0.0.1", help="Host interface to bind to (default: 127.0.0.1)")
344345
parser.add_argument("--port", type=int, default=8888, help="Port to bind the HTTP server to (default: 8888)")
345346
parser.add_argument("--java-home", "--jdk-home", dest="java_home", type=str, default="/usr/lib/jvm/java-21-openjdk-amd64", help="Path to JDK to use when executing Gradle build/test tasks")
346347
args = parser.parse_args()
347348

348349
PORT = args.port
349350
CUSTOM_JAVA_HOME = args.java_home
350351

351-
server_address = ("0.0.0.0", PORT)
352+
server_address = (args.host, PORT)
352353
httpd = http.server.ThreadingHTTPServer(server_address, CatalogRequestHandler)
353-
print(f"🚀 Interactive Catalog API Server running on port {PORT} (JDK Home: {CUSTOM_JAVA_HOME})...")
354+
print(f"🚀 Interactive Catalog API Server running on http://{args.host}:{PORT} (JDK Home: {CUSTOM_JAVA_HOME})...")
354355
try:
355356
httpd.serve_forever()
356357
except KeyboardInterrupt:

0 commit comments

Comments
 (0)