Skip to content

Commit

Permalink
change multi camera target sdk version to 33
Browse files Browse the repository at this point in the history
Android 12 and above expect target sdk version above 30

changed multi camera application target sdk version to 33
and removed unwated external storage access

Tracked-On: OAM-122128
Signed-off-by: shivasku82 <[email protected]>
  • Loading branch information
shivasku82 authored and sysopenci committed Jul 12, 2024
1 parent 5ae70ed commit 997e812
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 33 deletions.
3 changes: 2 additions & 1 deletion camera/MultiCameraApplication/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.intel.multicamera">

<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="30"/>
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="33"/>

<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Expand Down Expand Up @@ -32,6 +32,7 @@
<activity
android:name=".FullScreenActivity"
android:label="@string/app_name"
android:exported="true"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,6 @@ private void checkPermissions() {
PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.RECORD_AUDIO) ==
PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.READ_EXTERNAL_STORAGE) ==
PackageManager.PERMISSION_GRANTED;

if (!mHasCriticalPermissions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class PermissionsActivity extends QuickActivity {
private int mIndexPermissionRequestStorage;
private boolean mShouldRequestCameraPermission;
private boolean mShouldRequestMicrophonePermission;
private boolean mShouldRequestStoragePermission;
private int mNumPermissionsToRequest;
private boolean mFlagHasCameraPermission;
private boolean mFlagHasMicrophonePermission;
Expand Down Expand Up @@ -122,15 +121,6 @@ private void checkPermissions() {
mFlagHasMicrophonePermission = true;
}

if (ActivityCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.WRITE_EXTERNAL_STORAGE) !=
PackageManager.PERMISSION_GRANTED) {
mNumPermissionsToRequest++;
mShouldRequestStoragePermission = true;
} else {
mFlagHasStoragePermission = true;
}

if (mNumPermissionsToRequest != 0) {
if (!convertToBoolean(getString("pref_has_seen_permissions_dialogs", "false"))) {
buildPermissionsRequest();
Expand Down Expand Up @@ -160,12 +150,6 @@ private void buildPermissionsRequest() {
mIndexPermissionRequestMicrophone = permissionsRequestIndex;
permissionsRequestIndex++;
}
if (mShouldRequestStoragePermission) {
permissionsToRequest[permissionsRequestIndex] =
Manifest.permission.WRITE_EXTERNAL_STORAGE;
mIndexPermissionRequestStorage = permissionsRequestIndex;
permissionsRequestIndex++;
}

Log.v(TAG, "requestPermissions count: " + permissionsToRequest.length);
requestPermissions(permissionsToRequest, PERMISSION_REQUEST_CODE);
Expand Down Expand Up @@ -195,16 +179,7 @@ public void onRequestPermissionsResult(int requestCode, String permissions[],
handlePermissionsFailure();
}
}
if (mShouldRequestStoragePermission) {
if (grantResults.length > 0 &&
grantResults[mIndexPermissionRequestStorage] == PackageManager.PERMISSION_GRANTED) {
mFlagHasStoragePermission = true;
} else {
handlePermissionsFailure();
}
}

if (mFlagHasCameraPermission && mFlagHasMicrophonePermission && mFlagHasStoragePermission) {
if (mFlagHasCameraPermission && mFlagHasMicrophonePermission) {
handlePermissionsSuccess();
} else {
// Permissions dialog has already been shown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,6 @@ private void checkPermissions() {
PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.RECORD_AUDIO) ==
PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.READ_EXTERNAL_STORAGE) ==
PackageManager.PERMISSION_GRANTED;

if (!mHasCriticalPermissions) {
Expand Down

0 comments on commit 997e812

Please sign in to comment.