Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3428bb6
base: overlays: Add Pebble icon shape
aryaman895 Oct 6, 2020
a7dd354
base: Port extended screenshot function from OOS
jhenrique09 Aug 11, 2019
641227d
base: Port face unlock feature [3/4]
jhenrique09 Mar 26, 2020
aed2761
SystemUI: Allow listening for face only on pin/pass view
jhenrique09 Mar 28, 2020
3d02976
base: do not use new lockscreen layout for bypass
ethan-halsall Apr 9, 2020
1aff649
base: Grant storage permissions to Google Markup
DennySPB Aug 26, 2019
ca59744
SystemUI: Implement Smart space
jhenrique09 Sep 13, 2019
7066c6f
QS: Add Reboot/Recovery QS Tile
fusionjack Nov 16, 2017
c4e2c34
PackageInstaller: Fix crash when uninstalling apps with fragile data
luk1337 Aug 25, 2020
038edc7
base: Use 2 modalities concurrently in BiometricPrompt if available
ritujb May 11, 2020
25d8513
SystemUI: BiometricPrompt: Adjust layout if FOD is present
ritujb May 18, 2020
2fbe83c
SystemUI: BiometricPrompt: Call onDialogAnimatedIn when we are showin…
ritujb May 19, 2020
e4ed0e7
SystemUI: BiometricDialogView: Fix missing package manager member
evan-a-a Jul 15, 2020
df520f8
SystemUI: Hide non-system overlays when biometric prompt is showing
ritujb Jul 25, 2020
5acc1b7
base: Introduce Applock [1/2]
ritujb Apr 30, 2020
a22f229
BiometricPrompt: Force portrait orientation if we have FOD
ritujb Sep 26, 2020
2e9d441
base: AppLock v1.1
ritujb Jul 25, 2020
36451da
Allow longpress power button to toggle torch [1/2]
ezio84 Sep 3, 2017
71ea742
fw/b torch: Let long press power turn torch off when screen is on.
sam3000 Jul 23, 2020
8ec8e92
base: Smart Charging (1/4)
Lucchetto Mar 28, 2019
ce41842
Smart Charging: rework for using more common sysfs node [1/2]
DennySPB May 17, 2019
5d65a04
Smart Charging: allow using device overlays
DennySPB Sep 17, 2019
9a54787
Smart Charging: allow user set resume level [1/2]
DennySPB Jun 18, 2019
1d3b930
frameworks: Reset battery stats [1/2]
jruesga Nov 24, 2015
d6626cb
Smart Charging: add reset battery stats option [1/2]
DennySPB Jun 26, 2019
76f1a73
base: Grant battery stats reset permission to Settings
kdrag0n Dec 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ java_defaults {
"core/java/android/app/IAlarmListener.aidl",
"core/java/android/app/IAlarmManager.aidl",
"core/java/android/app/IAppTask.aidl",
"core/java/android/app/IAppLockCallback.aidl",
"core/java/android/app/IAppLockService.aidl",
"core/java/android/app/IApplicationThread.aidl",
"core/java/android/app/IAssistDataReceiver.aidl",
"core/java/android/app/ITaskStackListener.aidl",
Expand Down Expand Up @@ -695,6 +697,12 @@ java_defaults {
":platform-properties",

":framework-statslog-gen",

// Long screenshot
"core/java/com/android/internal/custom/longshot/ILongScreenshot.aidl",
"core/java/com/android/internal/custom/longshot/ILongScreenshotCallback.aidl",
"core/java/com/android/internal/custom/longshot/ILongScreenshotListener.aidl",
"core/java/com/android/internal/custom/longshot/ILongScreenshotManager.aidl",
],

aidl: {
Expand Down
143 changes: 143 additions & 0 deletions core/java/android/app/AppLockManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/**
* Copyright (C) 2017-2020 Paranoid Android
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.app;

import android.annotation.SystemService;
import android.content.Context;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;

import java.util.List;

/**
* @author Anas Karbila
* @author Rituj Beniwal
* @hide
*/
@SystemService(Context.APPLOCK_SERVICE)
public class AppLockManager {

private static final String TAG = "AppLockManager";

private IAppLockService mService;

public AppLockManager(IAppLockService service) {
mService = service;
}

public void addAppToList(String packageName) {
try {
mService.addAppToList(packageName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public void removeAppFromList(String packageName) {
try {
mService.removeAppFromList(packageName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public boolean isAppLocked(String packageName) {
try {
return mService.isAppLocked(packageName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public boolean isAppOpen(String packageName) {
try {
return mService.isAppOpen(packageName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public void setShowOnlyOnWake(boolean showOnce) {
try {
mService.setShowOnlyOnWake(showOnce);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public boolean getShowOnlyOnWake() {
try {
return mService.getShowOnlyOnWake();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public int getLockedAppsCount() {
try {
return mService.getLockedAppsCount();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public List<String> getLockedPackages() {
try {
return mService.getLockedPackages();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public boolean getAppNotificationHide(String packageName) {
try {
return mService.getAppNotificationHide(packageName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public void setAppNotificationHide(String packageName, boolean hide) {
try {
mService.setAppNotificationHide(packageName, hide);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public void addAppLockCallback(IAppLockCallback c) {
try {
mService.addAppLockCallback(c);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public void removeAppLockCallback(IAppLockCallback c) {
try {
mService.removeAppLockCallback(c);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}

public abstract static class AppLockCallback extends IAppLockCallback.Stub {
@Override
public abstract void onAppStateChanged(String pkg);
};
}
23 changes: 23 additions & 0 deletions core/java/android/app/IAppLockCallback.aidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright (C) 2017-2020 Paranoid Android
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.app;

/** @hide */
oneway interface IAppLockCallback {

void onAppStateChanged(String packageName);
}
47 changes: 47 additions & 0 deletions core/java/android/app/IAppLockService.aidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright (C) 2017-2020 Paranoid Android
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.app;

import android.app.IAppLockCallback;

/** @hide */
interface IAppLockService {

void addAppToList(in String packageName);

void removeAppFromList(in String packageName);

boolean isAppLocked(in String packageName);

boolean isAppOpen(in String packageName);

void setShowOnlyOnWake(in boolean showOnce);

boolean getShowOnlyOnWake();

int getLockedAppsCount();

List<String> getLockedPackages();

boolean getAppNotificationHide(in String packageName);

void setAppNotificationHide(in String packageName, in boolean hide);

void addAppLockCallback(IAppLockCallback callback);

void removeAppLockCallback(IAppLockCallback callback);
}
18 changes: 18 additions & 0 deletions core/java/android/app/SystemServiceRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
import com.android.internal.app.IBatteryStats;
import com.android.internal.app.ISoundTriggerService;
import com.android.internal.appwidget.IAppWidgetService;
import com.android.internal.custom.longshot.LongScreenshotManager;
import com.android.internal.net.INetworkWatchlistManager;
import com.android.internal.os.IDropBoxManagerService;
import com.android.internal.policy.PhoneLayoutInflater;
Expand Down Expand Up @@ -958,6 +959,15 @@ public BiometricManager createService(ContextImpl ctx)
}
});

registerService(Context.APPLOCK_SERVICE, AppLockManager.class,
new CachedServiceFetcher<AppLockManager>() {
@Override
public AppLockManager createService(ContextImpl ctx) throws ServiceNotFoundException {
IBinder b = ServiceManager.getServiceOrThrow(Context.APPLOCK_SERVICE);
IAppLockService service = IAppLockService.Stub.asInterface(b);
return new AppLockManager(service);
}});

registerService(Context.TV_INPUT_SERVICE, TvInputManager.class,
new CachedServiceFetcher<TvInputManager>() {
@Override
Expand Down Expand Up @@ -1300,6 +1310,14 @@ public DynamicSystemManager createService(ContextImpl ctx)
return new DynamicSystemManager(
IDynamicSystemService.Stub.asInterface(b));
}});

registerService(Context.LONGSCREENSHOT_SERVICE, LongScreenshotManager.class,
new CachedServiceFetcher<LongScreenshotManager>() {
@Override
public LongScreenshotManager createService(ContextImpl ctx)
throws ServiceNotFoundException {
return LongScreenshotManager.getInstance();
}});
//CHECKSTYLE:ON IndentationCheck
}

Expand Down
16 changes: 16 additions & 0 deletions core/java/android/content/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -4685,6 +4685,22 @@ public abstract boolean startInstrumentation(@NonNull ComponentName className,
*/
public static final String DYNAMIC_SYSTEM_SERVICE = "dynamic_system";

/**
* Long screenshot
* @hide
*/
public static final String LONGSCREENSHOT_SERVICE = "longshot";

/**
* Use with {@link #getSystemService} to retrieve a
* {@link android.app.AppLockManager} for accessing and setting locked apps state.
*
* @hide
* @see #getSystemService
* @see android.app.AppLockManager
*/
public static final String APPLOCK_SERVICE = "applock";

/**
* Determine whether the given permission is allowed for a particular
* process and user ID running in the system.
Expand Down
15 changes: 15 additions & 0 deletions core/java/android/hardware/biometrics/BiometricPrompt.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
* @hide
*/
public static final String KEY_USE_DEFAULT_TITLE = "use_default_title";
/**
* @hide
*/
public static final String KEY_APPLOCK_PKG = "applock_package_name";
/**
* @hide
*/
Expand Down Expand Up @@ -160,6 +164,17 @@ public Builder(Context context) {
return this;
}

/**
* Optional: Show a special dialog for app locker if KEY_APPLOCK_PKG is set
* @param packageName
* @return
* @hide
*/
@NonNull public Builder setApplockPackage(@NonNull CharSequence packageName) {
mBundle.putCharSequence(KEY_APPLOCK_PKG, packageName);
return this;
}

/**
* Optional: Set the subtitle to display.
* @param subtitle
Expand Down
53 changes: 53 additions & 0 deletions core/java/android/hardware/face/FaceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,59 @@ public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSi
}
}

/**
* Request face authentication enrollment. This call operates the face authentication hardware
* and starts capturing images. Progress will be indicated by callbacks to the
* {@link EnrollmentCallback} object. It terminates when
* {@link EnrollmentCallback#onEnrollmentError(int, CharSequence)} or
* {@link EnrollmentCallback#onEnrollmentProgress(int) is called with remaining == 0, at
* which point the object is no longer valid. The operation can be canceled by using the
* provided cancel object.
*
* @param token a unique token provided by a recent creation or verification of device
* credentials (e.g. pin, pattern or password).
* @param cancel an object that can be used to cancel enrollment
* @param flags optional flags
* @param callback an object to receive enrollment events
* @hide
*/
@RequiresPermission(MANAGE_BIOMETRIC)
public void enroll(byte[] token, CancellationSignal cancel,
EnrollmentCallback callback, int[] disabledFeatures) {
if (callback == null) {
throw new IllegalArgumentException("Must supply an enrollment callback");
}

if (cancel != null) {
if (cancel.isCanceled()) {
Log.w(TAG, "enrollment already canceled");
return;
} else {
cancel.setOnCancelListener(new OnEnrollCancelListener());
}
}

if (mService != null) {
try {
mEnrollmentCallback = callback;
Trace.beginSection("FaceManager#enroll");
mService.enrollMoto(mToken, token, mServiceReceiver,
mContext.getOpPackageName(), disabledFeatures);
} catch (RemoteException e) {
Log.w(TAG, "Remote exception in enroll: ", e);
if (callback != null) {
// Though this may not be a hardware issue, it will cause apps to give up or
// try again later.
callback.onEnrollmentError(FACE_ERROR_HW_UNAVAILABLE,
getErrorString(mContext, FACE_ERROR_HW_UNAVAILABLE,
0 /* vendorCode */));
}
} finally {
Trace.endSection();
}
}
}

/**
* Request face authentication enrollment. This call operates the face authentication hardware
* and starts capturing images. Progress will be indicated by callbacks to the
Expand Down
5 changes: 5 additions & 0 deletions core/java/android/hardware/face/IFaceService.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,9 @@ interface IFaceService {
void getFeature(int userId, int feature, IFaceServiceReceiver receiver, String opPackageName);

void userActivity();

// Moto additions
// Start face enrollment
void enrollMoto(IBinder token, in byte [] cryptoToken, IFaceServiceReceiver receiver,
String opPackageName, in int [] disabledFeatures);
}
Loading