-
Notifications
You must be signed in to change notification settings - Fork 0
Add NEARBY_WIFI_DEVICES permission #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nbschultz97
wants to merge
9
commits into
main
Choose a base branch
from
codex/add-nearby-wifi-devices-permission
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
366fa11
Ignore generated assets
nbschultz97 1abe779
Handle Nearby Wi-Fi permission dynamically
nbschultz97 2ae2fb5
Handle Nearby Wi-Fi permission dynamically
nbschultz97 9deabec
Merge pull request #8 from nbschultz97/codex/fix-comments-jiqls1
nbschultz97 12c2ebb
Specify exported attribute for launcher activity
nbschultz97 2503044
Merge pull request #12 from nbschultz97/codex/fix-comments-in-mainact…
nbschultz97 3828f8b
fix: add exported attribute to MainActivity
nbschultz97 abf7b28
Merge pull request #13 from nbschultz97/codex/fix-comments-in-android…
nbschultz97 6527396
Merge pull request #7 from nbschultz97/codex/fix-comments
nbschultz97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # Generated binary assets | ||
| app/ | ||
| app/src/main/assets/ | ||
| app/src/main/res/drawable/ | ||
| __pycache__/ |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="com.vantagescanner"> | ||
|
|
||
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
| <uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" /> | ||
|
|
||
| <application> | ||
| <activity android:name=".MainActivity"> | ||
| <intent-filter> | ||
| <action android:name="android.intent.action.MAIN" /> | ||
| <category android:name="android.intent.category.LAUNCHER" /> | ||
| </intent-filter> | ||
| </activity> | ||
| </application> | ||
| </manifest> | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.vantagescanner | ||
|
|
||
| import android.Manifest | ||
| import android.content.pm.PackageManager | ||
| import android.os.Build | ||
| import android.os.Bundle | ||
| import androidx.appcompat.app.AppCompatActivity | ||
| import androidx.core.app.ActivityCompat | ||
| import androidx.core.content.ContextCompat | ||
|
|
||
| class MainActivity : AppCompatActivity() { | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| checkPermissionsAndStart() | ||
| } | ||
|
|
||
| private fun checkPermissionsAndStart() { | ||
| val required = mutableListOf(Manifest.permission.ACCESS_FINE_LOCATION) | ||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
| required += Manifest.permission.NEARBY_WIFI_DEVICES | ||
| } | ||
| val missing = required.filter { | ||
| ContextCompat.checkSelfPermission(this, it) != PackageManager.PERMISSION_GRANTED | ||
| } | ||
| if (missing.isEmpty()) { | ||
| // start scanning when implementing CSI pose estimation | ||
| } else { | ||
| ActivityCompat.requestPermissions(this, missing.toTypedArray(), 0) | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.