Loading core/java/android/hardware/face/FaceManager.java +4 −27 Original line number Diff line number Diff line Loading @@ -168,31 +168,6 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan mHandler = new MyHandler(context); } /** * Request authentication of a crypto object. This call operates the face recognition hardware * and starts capturing images. It terminates when * {@link AuthenticationCallback#onAuthenticationError(int, CharSequence)} or * {@link AuthenticationCallback#onAuthenticationSucceeded(AuthenticationResult)} is called, at * which point the object is no longer valid. The operation can be canceled by using the * provided cancel object. * * @param crypto object associated with the call or null if none required. * @param cancel an object that can be used to cancel authentication * @param callback an object to receive authentication events * @param handler an optional handler to handle callback events * @throws IllegalArgumentException if the crypto operation is not supported or is not backed * by * <a href="{@docRoot}training/articles/keystore.html">Android * Keystore facility</a>. * @throws IllegalStateException if the crypto primitive is not initialized. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, @Nullable Handler handler) { authenticate(crypto, cancel, callback, handler, mContext.getUserId()); } /** * Use the provided handler thread for events. */ Loading Loading @@ -224,8 +199,10 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan * @throws IllegalStateException if the crypto primitive is not initialized. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, @Nullable Handler handler, int userId) { @NonNull AuthenticationCallback callback, @Nullable Handler handler, int userId, boolean isKeyguardBypassEnabled) { if (callback == null) { throw new IllegalArgumentException("Must supply an authentication callback"); } Loading @@ -247,7 +224,7 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan final long operationId = crypto != null ? crypto.getOpId() : 0; Trace.beginSection("FaceManager#authenticate"); mService.authenticate(mToken, operationId, userId, mServiceReceiver, mContext.getOpPackageName()); mContext.getOpPackageName(), isKeyguardBypassEnabled); } catch (RemoteException e) { Slog.w(TAG, "Remote exception while authenticating: ", e); if (callback != null) { Loading core/java/android/hardware/face/IFaceService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ interface IFaceService { // Authenticate the given sessionId with a face void authenticate(IBinder token, long operationId, int userId, IFaceServiceReceiver receiver, String opPackageName); String opPackageName, boolean isKeyguardBypassEnabled); // Uses the face hardware to detect for the presence of a face, without giving details // about accept/reject/lockout. Loading core/java/com/android/internal/os/BinderCallsStats.java +3 −2 Original line number Diff line number Diff line Loading @@ -220,8 +220,9 @@ public class BinderCallsStats implements BinderInternal.Observer { public CallSession callStarted(Binder binder, int code, int workSourceUid) { noteNativeThreadId(); boolean collectCpu = canCollect(); // We always want to collect data for latency if it's enabled, regardless of device state. if (!mCollectLatencyData && !canCollect()) { if (!mCollectLatencyData && !collectCpu) { return null; } Loading @@ -233,7 +234,7 @@ public class BinderCallsStats implements BinderInternal.Observer { s.timeStarted = -1; s.recordedCall = shouldRecordDetailedData(); if (mRecordingAllTransactionsForUid || s.recordedCall) { if (collectCpu && (mRecordingAllTransactionsForUid || s.recordedCall)) { s.cpuTimeStarted = getThreadTimeMicro(); s.timeStarted = getElapsedRealtimeMicro(); } else if (mCollectLatencyData) { Loading packages/EasterEgg/AndroidManifest.xml +66 −35 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.egg" android:versionCode="1" android:versionCode="12" android:versionName="1.0"> <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <!-- used for cat notifications --> <uses-permission android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME" /> <!-- used to save cat images --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- controls --> <uses-permission android:name="android.permission.BIND_CONTROLS" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".quares.QuaresActivity" <activity android:name=".quares.QuaresActivity" android:exported="true" android:icon="@drawable/q_icon" android:label="@string/q_egg_name" android:exported="true" android:theme="@style/QuaresTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -29,9 +31,9 @@ <activity android:name=".paint.PaintActivity" android:configChanges="orientation|keyboardHidden|screenSize|uiMode" android:exported="true" android:icon="@drawable/p_icon" android:label="@string/p_egg_name" android:exported="true" android:theme="@style/AppTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -39,13 +41,15 @@ </activity> <!-- Android N easter egg bits --> <activity android:name=".neko.NekoLand" android:theme="@android:style/Theme.Material.NoActionBar" <activity android:name=".neko.NekoLand" android:exported="true" android:label="@string/app_name"> android:label="@string/app_name" android:theme="@android:style/Theme.Material.NoActionBar"> <intent-filter> <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" /> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> Loading @@ -54,25 +58,24 @@ <service android:name=".neko.NekoService" android:enabled="true" android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true" > </service> android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" /> <!-- Used to show over lock screen --> <activity android:name=".neko.NekoLockedActivity" <activity android:name=".neko.NekoLockedActivity" android:excludeFromRecents="true" android:exported="true" android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar" android:showOnLockScreen="true" /> android:showOnLockScreen="true" android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar" /> <!-- Used to enable easter egg --> <activity android:name=".neko.NekoActivationActivity" <activity android:name=".ComponentActivationActivity" android:excludeFromRecents="true" android:exported="true" android:theme="@android:style/Theme.NoDisplay" > android:theme="@android:style/Theme.NoDisplay"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="com.android.internal.category.PLATLOGO" /> </intent-filter> Loading @@ -81,37 +84,65 @@ <!-- The quick settings tile, disabled by default --> <service android:name=".neko.NekoTile" android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" android:icon="@drawable/stat_icon" android:enabled="false" android:exported="true" android:label="@string/default_tile_name"> android:icon="@drawable/stat_icon" android:label="@string/default_tile_name" android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> <intent-filter> <action android:name="android.service.quicksettings.action.QS_TILE" /> </intent-filter> </service> <service android:name=".neko.NekoControlsService" android:permission="android.permission.BIND_CONTROLS" android:label="@string/r_egg_name" android:icon="@drawable/ic_fullcat_icon" <service android:name=".neko.NekoControlsService" android:enabled="false" android:exported="true"> android:exported="true" android:icon="@drawable/ic_fullcat_icon" android:label="@string/r_egg_name" android:permission="android.permission.BIND_CONTROLS"> <intent-filter> <action android:name="android.service.controls.ControlsProviderService" /> </intent-filter> </service> <!-- FileProvider for sending pictures --> </service> <!-- FileProvider for sending pictures --> <provider android:name="androidx.core.content.FileProvider" android:authorities="com.android.egg.fileprovider" android:grantUriPermissions="true" android:exported="false"> android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" /> </provider> <!-- Android S easter egg bits --> <!-- List of all system theme colors on the device. --> <activity android:name=".widget.PaintChipsActivity" android:theme="@android:style/Theme.Material.Wallpaper.NoTitleBar" android:configChanges="orientation|keyboardHidden|screenSize|uiMode" android:label="@string/s_egg_name" android:enabled="false" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <!-- Homescreen widget also showing paint chips (may be affected by the exact position in the workspace) --> <receiver android:name=".widget.PaintChipsWidget" android:label="@string/s_egg_name" android:enabled="false"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/paint_chips_widget_info" /> </receiver> </application> </manifest> No newline at end of file packages/EasterEgg/build.gradle +6 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.0.0-alpha08' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30" } } Loading Loading @@ -62,6 +62,9 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } buildFeatures { viewBinding true } } Loading @@ -74,6 +77,7 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6' implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}" implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}" implementation 'com.google.android.material:material:1.3.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' Loading Loading
core/java/android/hardware/face/FaceManager.java +4 −27 Original line number Diff line number Diff line Loading @@ -168,31 +168,6 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan mHandler = new MyHandler(context); } /** * Request authentication of a crypto object. This call operates the face recognition hardware * and starts capturing images. It terminates when * {@link AuthenticationCallback#onAuthenticationError(int, CharSequence)} or * {@link AuthenticationCallback#onAuthenticationSucceeded(AuthenticationResult)} is called, at * which point the object is no longer valid. The operation can be canceled by using the * provided cancel object. * * @param crypto object associated with the call or null if none required. * @param cancel an object that can be used to cancel authentication * @param callback an object to receive authentication events * @param handler an optional handler to handle callback events * @throws IllegalArgumentException if the crypto operation is not supported or is not backed * by * <a href="{@docRoot}training/articles/keystore.html">Android * Keystore facility</a>. * @throws IllegalStateException if the crypto primitive is not initialized. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, @Nullable Handler handler) { authenticate(crypto, cancel, callback, handler, mContext.getUserId()); } /** * Use the provided handler thread for events. */ Loading Loading @@ -224,8 +199,10 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan * @throws IllegalStateException if the crypto primitive is not initialized. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, @Nullable Handler handler, int userId) { @NonNull AuthenticationCallback callback, @Nullable Handler handler, int userId, boolean isKeyguardBypassEnabled) { if (callback == null) { throw new IllegalArgumentException("Must supply an authentication callback"); } Loading @@ -247,7 +224,7 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan final long operationId = crypto != null ? crypto.getOpId() : 0; Trace.beginSection("FaceManager#authenticate"); mService.authenticate(mToken, operationId, userId, mServiceReceiver, mContext.getOpPackageName()); mContext.getOpPackageName(), isKeyguardBypassEnabled); } catch (RemoteException e) { Slog.w(TAG, "Remote exception while authenticating: ", e); if (callback != null) { Loading
core/java/android/hardware/face/IFaceService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ interface IFaceService { // Authenticate the given sessionId with a face void authenticate(IBinder token, long operationId, int userId, IFaceServiceReceiver receiver, String opPackageName); String opPackageName, boolean isKeyguardBypassEnabled); // Uses the face hardware to detect for the presence of a face, without giving details // about accept/reject/lockout. Loading
core/java/com/android/internal/os/BinderCallsStats.java +3 −2 Original line number Diff line number Diff line Loading @@ -220,8 +220,9 @@ public class BinderCallsStats implements BinderInternal.Observer { public CallSession callStarted(Binder binder, int code, int workSourceUid) { noteNativeThreadId(); boolean collectCpu = canCollect(); // We always want to collect data for latency if it's enabled, regardless of device state. if (!mCollectLatencyData && !canCollect()) { if (!mCollectLatencyData && !collectCpu) { return null; } Loading @@ -233,7 +234,7 @@ public class BinderCallsStats implements BinderInternal.Observer { s.timeStarted = -1; s.recordedCall = shouldRecordDetailedData(); if (mRecordingAllTransactionsForUid || s.recordedCall) { if (collectCpu && (mRecordingAllTransactionsForUid || s.recordedCall)) { s.cpuTimeStarted = getThreadTimeMicro(); s.timeStarted = getElapsedRealtimeMicro(); } else if (mCollectLatencyData) { Loading
packages/EasterEgg/AndroidManifest.xml +66 −35 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.egg" android:versionCode="1" android:versionCode="12" android:versionName="1.0"> <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <!-- used for cat notifications --> <uses-permission android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME" /> <!-- used to save cat images --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- controls --> <uses-permission android:name="android.permission.BIND_CONTROLS" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".quares.QuaresActivity" <activity android:name=".quares.QuaresActivity" android:exported="true" android:icon="@drawable/q_icon" android:label="@string/q_egg_name" android:exported="true" android:theme="@style/QuaresTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -29,9 +31,9 @@ <activity android:name=".paint.PaintActivity" android:configChanges="orientation|keyboardHidden|screenSize|uiMode" android:exported="true" android:icon="@drawable/p_icon" android:label="@string/p_egg_name" android:exported="true" android:theme="@style/AppTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -39,13 +41,15 @@ </activity> <!-- Android N easter egg bits --> <activity android:name=".neko.NekoLand" android:theme="@android:style/Theme.Material.NoActionBar" <activity android:name=".neko.NekoLand" android:exported="true" android:label="@string/app_name"> android:label="@string/app_name" android:theme="@android:style/Theme.Material.NoActionBar"> <intent-filter> <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" /> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> Loading @@ -54,25 +58,24 @@ <service android:name=".neko.NekoService" android:enabled="true" android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true" > </service> android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" /> <!-- Used to show over lock screen --> <activity android:name=".neko.NekoLockedActivity" <activity android:name=".neko.NekoLockedActivity" android:excludeFromRecents="true" android:exported="true" android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar" android:showOnLockScreen="true" /> android:showOnLockScreen="true" android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar" /> <!-- Used to enable easter egg --> <activity android:name=".neko.NekoActivationActivity" <activity android:name=".ComponentActivationActivity" android:excludeFromRecents="true" android:exported="true" android:theme="@android:style/Theme.NoDisplay" > android:theme="@android:style/Theme.NoDisplay"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="com.android.internal.category.PLATLOGO" /> </intent-filter> Loading @@ -81,37 +84,65 @@ <!-- The quick settings tile, disabled by default --> <service android:name=".neko.NekoTile" android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" android:icon="@drawable/stat_icon" android:enabled="false" android:exported="true" android:label="@string/default_tile_name"> android:icon="@drawable/stat_icon" android:label="@string/default_tile_name" android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> <intent-filter> <action android:name="android.service.quicksettings.action.QS_TILE" /> </intent-filter> </service> <service android:name=".neko.NekoControlsService" android:permission="android.permission.BIND_CONTROLS" android:label="@string/r_egg_name" android:icon="@drawable/ic_fullcat_icon" <service android:name=".neko.NekoControlsService" android:enabled="false" android:exported="true"> android:exported="true" android:icon="@drawable/ic_fullcat_icon" android:label="@string/r_egg_name" android:permission="android.permission.BIND_CONTROLS"> <intent-filter> <action android:name="android.service.controls.ControlsProviderService" /> </intent-filter> </service> <!-- FileProvider for sending pictures --> </service> <!-- FileProvider for sending pictures --> <provider android:name="androidx.core.content.FileProvider" android:authorities="com.android.egg.fileprovider" android:grantUriPermissions="true" android:exported="false"> android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" /> </provider> <!-- Android S easter egg bits --> <!-- List of all system theme colors on the device. --> <activity android:name=".widget.PaintChipsActivity" android:theme="@android:style/Theme.Material.Wallpaper.NoTitleBar" android:configChanges="orientation|keyboardHidden|screenSize|uiMode" android:label="@string/s_egg_name" android:enabled="false" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <!-- Homescreen widget also showing paint chips (may be affected by the exact position in the workspace) --> <receiver android:name=".widget.PaintChipsWidget" android:label="@string/s_egg_name" android:enabled="false"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/paint_chips_widget_info" /> </receiver> </application> </manifest> No newline at end of file
packages/EasterEgg/build.gradle +6 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.0.0-alpha08' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30" } } Loading Loading @@ -62,6 +62,9 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } buildFeatures { viewBinding true } } Loading @@ -74,6 +77,7 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6' implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}" implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}" implementation 'com.google.android.material:material:1.3.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' Loading