Launcher3: Standalone studio build

This commit is contained in:
Kshitij Gupta committed 2021-02-28 02:57:05 +05:30
1 parent d89d3ab882
commit 16275e5c04
13 files changed
+73 -21

No files matched your search

+1
View File
@@ -56,6 +56,7 @@
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
+30 -5
View File
@@ -10,8 +10,28 @@ buildscript {
}
}
final String ANDROID_TOP = "${rootDir}/../../.."
final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"
final String FRAMEWORK_PREBUILTS_DIR = "prebuilts"
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
ext.addFrameworkJar = { String path ->
def frameworkJar = new File(rootProject.projectDir, 'prebuilts/libs/' + path)
if (!frameworkJar.exists()) {
throw new IllegalArgumentException("Framework jar path doesn't exist")
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.bootstrapClasspath = files([frameworkJar] + (options.bootstrapClasspath.files as Iterable<File>))
}
}
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
@@ -47,13 +67,13 @@ android {
productFlavors {
aosp {
dimension "app"
applicationId 'com.android.launcher3'
applicationId 'ch.deletescape.lawnchair'
testApplicationId 'com.android.launcher3.tests'
}
l3go {
dimension "app"
applicationId 'com.android.launcher3'
applicationId 'ch.deletescape.lawnchair'
testApplicationId 'com.android.launcher3.tests'
}
@@ -132,6 +152,8 @@ android {
manifest.srcFile "quickstep/AndroidManifest.xml"
}
}
addFrameworkJar('framework.jar')
}
allprojects {
@@ -151,9 +173,10 @@ dependencies {
implementation project(':IconLoader')
withQuickstepImplementation project(':SharedLibWrapper')
implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'launcher_protos.jar')
implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'sysui_statslog.jar')
// Recents lib dependency
withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'sysui_shared.jar')
// Required for AOSP to compile. This is already included in the sysui_shared.jar
withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
@@ -166,6 +189,8 @@ dependencies {
androidTestImplementation 'com.android.support.test:rules:1.0.0'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
implementation 'com.google.protobuf.nano:protobuf-javanano:3.1.0'
implementation 'com.github.ChickenHook:RestrictionBypass:2.2'
}
protobuf {
+1 -1
View File
@@ -10,4 +10,4 @@ PROTOBUF_CLASS_PATH=com.google.protobuf:protobuf-gradle-plugin:0.8.8
PROTOBUF_DEPENDENCY=com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7
BUILD_TOOLS_VERSION=28.0.3
COMPILE_SDK=android-R
COMPILE_SDK=android-30
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -60,6 +60,7 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
<category android:name="android.intent.category.LAUNCHER_APP" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.android.launcher3.grid.control"
@@ -18,6 +18,7 @@ package com.android.launcher3.appprediction;
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_GRID;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import android.Manifest;
import android.annotation.TargetApi;
import android.app.prediction.AppPredictionContext;
import android.app.prediction.AppPredictionManager;
@@ -27,6 +28,7 @@ import android.app.prediction.AppTargetEvent;
import android.app.prediction.AppTargetId;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -111,6 +113,9 @@ public class PredictionAppTracker extends AppLaunchTracker
return null;
}
int usagePerm = mContext.checkCallingOrSelfPermission(Manifest.permission.PACKAGE_USAGE_STATS);
if (usagePerm != PackageManager.PERMISSION_GRANTED) return null;
AppPredictor predictor = apm.createAppPredictionSession(
new AppPredictionContext.Builder(mContext)
.setUiSurface(client.id)
@@ -21,6 +21,7 @@ import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.hybridhotseat.HotseatEduController.getSettingsIntent;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_RANKED;
import android.Manifest;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
@@ -30,6 +31,7 @@ import android.app.prediction.AppPredictor;
import android.app.prediction.AppTarget;
import android.app.prediction.AppTargetEvent;
import android.content.ComponentName;
import android.content.pm.PackageManager;
import android.os.Process;
import android.util.Log;
import android.view.HapticFeedbackConstants;
@@ -321,6 +323,11 @@ public class HotseatPredictionController implements DragController.DragListener,
mPredictionModel.createBundle(bundle -> {
if (mIsDestroyed) return;
int usagePerm = mLauncher.checkCallingOrSelfPermission(Manifest.permission.PACKAGE_USAGE_STATS);
if (usagePerm != PackageManager.PERMISSION_GRANTED) {
mAppPredictor = null;
return;
}
mAppPredictor = apm.createAppPredictionSession(
new AppPredictionContext.Builder(mLauncher)
.setUiSurface(PREDICTION_CLIENT)
@@ -61,23 +61,24 @@ public class DeviceFlag extends DebugFlag {
}
private void registerDeviceConfigChangedListener(Context context) {
DeviceConfig.addOnPropertiesChangedListener(
NAMESPACE_LAUNCHER,
context.getMainExecutor(),
properties -> {
if (!NAMESPACE_LAUNCHER.equals(properties.getNamespace())
|| !properties.getKeyset().contains(key)) {
return;
}
defaultValue = getDeviceValue(key, mDefaultValueInCode);
initialize(context);
for (Runnable r: mListeners) {
r.run();
}
});
// DeviceConfig.addOnPropertiesChangedListener(
// NAMESPACE_LAUNCHER,
// context.getMainExecutor(),
// properties -> {
// if (!NAMESPACE_LAUNCHER.equals(properties.getNamespace())
// || !properties.getKeyset().contains(key)) {
// return;
// }
// defaultValue = getDeviceValue(key, mDefaultValueInCode);
// initialize(context);
// for (Runnable r: mListeners) {
// r.run();
// }
// });
}
protected static boolean getDeviceValue(String key, boolean defaultValue) {
return DeviceConfig.getBoolean(NAMESPACE_LAUNCHER, key, defaultValue);
return defaultValue;
// return DeviceConfig.getBoolean(NAMESPACE_LAUNCHER, key, defaultValue);
}
}
@@ -17,6 +17,7 @@
package com.android.launcher3;
import android.content.Context;
import android.util.Log;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.graphics.BitmapCreationCheck;
@@ -24,12 +25,23 @@ import com.android.launcher3.graphics.IconShape;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.util.ResourceBasedOverride;
import org.chickenhook.restrictionbypass.Unseal;
/**
* Utility class to handle one time initializations of the main process
*/
public class MainProcessInitializer implements ResourceBasedOverride {
private static final String TAG = "MainProcessInitializer";
public static void initialize(Context context) {
try {
Unseal.unseal();
Log.i(TAG, "Unseal success!");
} catch (Exception e) {
Log.e(TAG, "Unseal fail!");
e.printStackTrace();
}
Overrides.getObject(
MainProcessInitializer.class, context, R.string.main_process_initializer_class)
.init(context);