Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from android/master
Browse files Browse the repository at this point in the history
Merge pull request #1 from android/master
  • Loading branch information
Canato authored Nov 30, 2020
2 parents f516906 + e06e0a9 commit 3fb0652
Show file tree
Hide file tree
Showing 24 changed files with 97 additions and 209 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/copy-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Duplicates default main branch to the old master branch

name: Duplicates main to old master branch

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "copy-branch"
copy-branch:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it,
# but specifies master branch (old default).
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master

- run: |
git config user.name github-actions
git config user.email [email protected]
git merge origin/main
git push
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.iml
.idea
.gradle
/local.properties
local.properties
.DS_Store
build/
/captures
Expand Down
10 changes: 4 additions & 6 deletions DataAccessAuditingKotlin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Android Data Access Auditing Sample (Kotlin)
===========================================

This sample demonstrates how to audit access to private data in your app via the data access
auditing APIs available in the Android R and above. This is really helpful when you have a very
auditing APIs available in the Android 11 and above. This is really helpful when you have a very
large app or use a 3rd party library and you want to make sure it isn't accessing data in a way
you wouldn't expect.

Expand All @@ -14,8 +14,8 @@ To provide more transparency into how your app and its dependencies access priva
Android 11 introduces data access auditing. By having insights from this process, you can better
identify and rectify potentially unexpected data access.

Your app can register an instance of AppOpsManager.OnOpNotedCallback, which can perform actions each
time one of the following events occurs:
Your app can register an instance of `AppOpsManager.OnOpNotedCallback`, which can perform actions
each time one of the following events occurs:

- Your app's code accesses private data. To help you determine which logical part of your app
invoked the event, you can audit data access by feature.
Expand All @@ -32,9 +32,7 @@ For more information, check out [the documentation](https://developer.android.co
Pre-requisites
--------------

- Android SDK R
- Android Build Tools v29.0.3
- Android Support Repository
- Android 11 SDK

Screenshots
-------------
Expand Down
24 changes: 5 additions & 19 deletions DataAccessAuditingKotlin/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 30
buildToolsVersion "30.0.0"

defaultConfig {
applicationId "com.example.android.dataaccessauditingkotlin"
minSdkVersion 30
targetSdkVersion 30
versionCode 1
versionName "1.0"
}

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildFeatures {
dataBinding = true
}

buildTypes {
Expand All @@ -38,27 +39,12 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

dataBinding {
enabled true
}
}

dependencies {
// Dependency on a local library module
implementation project(':thirdPartyLibrary')

implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0'

implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'com.google.android.material:material:1.2.1'
kapt 'com.android.databinding:compiler:3.1.4'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions DataAccessAuditingKotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.4.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Wed Jun 10 11:09:37 PDT 2020
#Tue Sep 01 16:26:17 PDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
10 changes: 1 addition & 9 deletions DataAccessAuditingKotlin/thirdPartyLibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 30
buildToolsVersion "30.0.0"

defaultConfig {
minSdkVersion 30
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}

Expand All @@ -37,13 +34,8 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
}
38 changes: 5 additions & 33 deletions RuntimePermissionsBasic/Application/build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,14 @@
apply plugin: 'com.android.application'

repositories {
google()
jcenter()
}

dependencies {
compile "com.android.support:support-v4:27.0.2"
compile "com.android.support:support-v13:27.0.2"
compile "com.android.support:cardview-v7:27.0.2"
compile "com.android.support:appcompat-v7:27.0.2"
compile 'com.android.support:design:27.0.2'
}

List<String> dirs = ['main']

android {
compileSdkVersion 27
compileSdkVersion 30

defaultConfig {
minSdkVersion 15
targetSdkVersion 27
targetSdkVersion 30
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

sourceSets {
main {
dirs.each { dir ->
java.srcDirs "src/${dir}/java"
res.srcDirs "src/${dir}/res"
}
}
androidTest.setRoot('tests')
androidTest.java.srcDirs = ['tests/src']

}
dependencies {
implementation 'com.google.android.material:material:1.2.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

import com.example.android.basicpermissions.camera.CameraPreviewActivity;
import com.google.android.material.snackbar.Snackbar;

/**
* Launcher Activity that demonstrates the use of runtime permissions for Android M.
Expand All @@ -44,14 +44,14 @@
* calling
* {@link ActivityCompat#requestPermissions(Activity, String[], int)}. The result of the request is
* returned to the
* {@link android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback}, which starts
* {@link androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback}, which starts
* {@link
* CameraPreviewActivity} if the permission has been granted.
* <p>
* Note that there is no need to check the API level, the support library
* already takes care of this. Similar helper methods for permissions are also available in
* ({@link ActivityCompat},
* {@link android.support.v4.content.ContextCompat} and {@link android.support.v4.app.Fragment}).
* {@link androidx.core.content.ContextCompat} and {@link androidx.fragment.app.Fragment}).
*/
public class MainActivity extends AppCompatActivity
implements ActivityCompat.OnRequestPermissionsResultCallback {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import android.os.Bundle;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.Toast;

import com.example.android.basicpermissions.R;

Expand Down Expand Up @@ -62,7 +61,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_camera);

// Get the rotation of the screen to adjust the preview image accordingly.
int displayRotation = getWindowManager().getDefaultDisplay().getRotation();
int displayRotation = getDisplay().getRotation();

// Create the Preview view and set it as the content of this Activity.
CameraPreview cameraPreview = new CameraPreview(this, null,
Expand Down
19 changes: 8 additions & 11 deletions RuntimePermissionsBasic/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
buildscript {
repositories {
google()
mavenCentral()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:4.1.1'
}
}











allprojects {
repositories {
google()
jcenter()
}
}
2 changes: 2 additions & 0 deletions RuntimePermissionsBasic/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android.enableJetifier=true
android.useAndroidX=true
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Tue Nov 10 21:55:26 PST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-4.10.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
Loading

0 comments on commit 3fb0652

Please sign in to comment.