You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
fixes for NewPipe version 0.28.0
This commit is contained in:
@@ -243,6 +243,8 @@ void atl_safe_gtk_widget_queue_resize(GtkWidget *widget)
|
||||
}
|
||||
|
||||
GVariant *intent_serialize(JNIEnv *env, jobject intent) {
|
||||
if (!intent)
|
||||
return NULL;
|
||||
jstring action_jstr = _GET_OBJ_FIELD(intent, "action", "Ljava/lang/String;");
|
||||
jobject component = _GET_OBJ_FIELD(intent, "component", "Landroid/content/ComponentName;");
|
||||
jstring className_jstr = component ? _GET_OBJ_FIELD(component, "mClass", "Ljava/lang/String;") : NULL;
|
||||
|
||||
@@ -512,8 +512,6 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
||||
this.intent = newIntent;
|
||||
}
|
||||
|
||||
public void unregisterReceiver(BroadcastReceiver receiver) {}
|
||||
|
||||
public Intent getParentActivityIntent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ import java.security.Provider;
|
||||
import java.security.Security;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class Context extends Object {
|
||||
private final static String TAG = "Context";
|
||||
@@ -99,7 +100,7 @@ public class Context extends Object {
|
||||
File cache_dir = null;
|
||||
File nobackup_dir = null;
|
||||
|
||||
private static Map<IntentFilter, BroadcastReceiver> receiverMap = new HashMap<IntentFilter, BroadcastReceiver>();
|
||||
private static Map<IntentFilter, BroadcastReceiver> receiverMap = new ConcurrentHashMap<IntentFilter, BroadcastReceiver>();
|
||||
|
||||
static {
|
||||
assets = new AssetManager();
|
||||
@@ -265,6 +266,8 @@ public class Context extends Object {
|
||||
}
|
||||
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
|
||||
if (receiver == null)
|
||||
return null;
|
||||
receiverMap.put(filter, receiver);
|
||||
return new Intent();
|
||||
}
|
||||
@@ -714,7 +717,9 @@ public class Context extends Object {
|
||||
|
||||
public void unbindService(ServiceConnection serviceConnection) {}
|
||||
|
||||
public void unregisterReceiver(BroadcastReceiver receiver) {}
|
||||
public void unregisterReceiver(BroadcastReceiver receiver) {
|
||||
while (receiverMap.values().remove(receiver));
|
||||
}
|
||||
|
||||
public Context createPackageContext(String dummy, int dummy2) {
|
||||
return this; // FIXME?
|
||||
|
||||
@@ -234,7 +234,7 @@ public class Intent implements Parcelable {
|
||||
}
|
||||
|
||||
public boolean getBooleanExtra(String name, boolean defaultValue) {
|
||||
return defaultValue;
|
||||
return extras.getBoolean(name, defaultValue);
|
||||
}
|
||||
|
||||
public Intent setAction(String action) {
|
||||
|
||||
@@ -1388,13 +1388,13 @@ public class PackageManager {
|
||||
public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {
|
||||
if (packageName.equals(Context.pkg.packageName)) {
|
||||
return PackageParser.generatePackageInfo(Context.pkg, new int[0], flags, 0, 0, new HashSet<>(), new PackageUserState());
|
||||
} else if (packageName.equals("atl")) {
|
||||
} else if (packageName.equals("atl") || packageName.equals("android")) {
|
||||
PackageInfo info = new PackageInfo();
|
||||
info.packageName = packageName;
|
||||
info.signatures = new Signature[0];
|
||||
info.signatures = new Signature[] { new Signature(new byte[0]) };
|
||||
return info;
|
||||
} else {
|
||||
throw new NameNotFoundException();
|
||||
throw new NameNotFoundException(packageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
12
src/api-impl/android/text/BidiFormatter.java
Normal file
12
src/api-impl/android/text/BidiFormatter.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package android.text;
|
||||
|
||||
public class BidiFormatter {
|
||||
|
||||
public static BidiFormatter getInstance() {
|
||||
return new BidiFormatter();
|
||||
}
|
||||
|
||||
public String unicodeWrap(String source) {
|
||||
return source;
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,10 @@ public class DateUtils {
|
||||
}
|
||||
|
||||
public static String formatElapsedTime(long elapsedMillis) {
|
||||
final long days = elapsedMillis / (24 * 60 * 60L);
|
||||
final long hours = elapsedMillis / (60 * 60L) % 24L;
|
||||
final long minutes = elapsedMillis / 60L % 60L;
|
||||
final long seconds = elapsedMillis % 60L;
|
||||
final long days = elapsedMillis / (24 * 60 * 60L * 1000L);
|
||||
final long hours = elapsedMillis / (60 * 60L * 1000L) % 24L;
|
||||
final long minutes = elapsedMillis / (60L * 1000L) % 60L;
|
||||
final long seconds = elapsedMillis / 1000L % 60L;
|
||||
|
||||
if (elapsedMillis < 0) {
|
||||
return "0:00";
|
||||
|
||||
@@ -389,6 +389,7 @@ srcs = [
|
||||
'android/telephony/SubscriptionManager.java',
|
||||
'android/telephony/TelephonyManager.java',
|
||||
'android/text/AutoText.java',
|
||||
'android/text/BidiFormatter.java',
|
||||
'android/text/BoringLayout.java',
|
||||
'android/text/ClipboardManager.java',
|
||||
'android/text/Editable.java',
|
||||
|
||||
Reference in New Issue
Block a user